in reply to Grab last line and print
The "short path" is this:
open FILE, '<', $file or die("Can't read $file: $!"); my $lastline; while (<FILE>) { $lastline = $_; }
Of course, you're still reading through the whole file, but at least you're not storing its whole contents in memory... as others have said, though, File::ReadBackwards is probably your best bet.
|
|---|