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.

<radiant.matrix>
A collection of thoughts and links from the minds of geeks
The Code that can be seen is not the true Code
I haven't found a problem yet that can't be solved by a well-placed trebuchet