in reply to How do I read a file line by line in reverse order (from EOF to start of file)
Reference Chapter 8 of the Perl Cookbook.open( FILE, "<$file_to_reverse" ) or die( "Can't open file file_to_reverse: $!" ); @lines = reverse <FILE>; foreach $line (@lines) { # do something with $line }
|
|---|