Printing one txt file to a new txt file backwards



I need to print an entire text file to a new text file backwards. I
have the following code, but it only prints the first line backwards,
and completely omits all the other lines of the original text file:

open IN, "< $file1";
open OUT, "> $file2";
print OUT reverse split '', <IN>;
close IN;
close OUT;


Any help would be appreciated!

.