in reply to reading N files
The problem is that the IN you open is the same at each iteration, because it is the filehandle slot into the IN symbol in package main. In your case, it is the same as using global variables: you always access the same variable, and you keep writing on it.
Don't fool yourself.
The solutions are in Fletch's post.
perl -ple'$_=reverse' <<<ti.xittelop@oivalf