in reply to reversing files line by line
In other words: You want to reimplement tac in Perl. Why? (Windows is no excuse here, there are also implementations of tac for Windows.)
Alexander