in reply to Re^2: Read the last line in a text file
in thread Read the last line in a text file

In addition to the more important observation that moritz made, I can never understand why so often do people seem to feel the need to reference only to dereference like that; i.e. if we assume we do want to slurp the file all at once, then

print +(<$file>)[-1]; # would do!
--
If you can't understand the incipit, then please check the IPB Campaign.

Replies are listed 'Best First'.
Re^4: Read the last line in a text file
by massa (Hermit) on Aug 25, 2008 at 11:44 UTC
    [X]->[Y] is more symmetric than +(X)[Y]... ;-)
    []s, HTH, Massa (κς,πμ,πλ)