Last line of file/Perl
David A. Sinck
plug-discuss@lists.plug.phoenix.az.us
Thu, 14 Nov 2002 13:52:38 -0700
\_ SMTP quoth Mike Starke on 11/14/2002 15:49 as having spake thusly:
\_
\_ On Thu, Nov 14, 2002 at 12:41:50PM -0800, Matt Alexander wrote:
\_ /_tail -1 somefile ?
\_ /_
\_
\_ I was actually looking for a Perl solution without having to read
\_ through the entire file.
use File::Tail;
or perldoc -f seek, then backtrack. Something like
seek(FH,2,$suspected_last_line_size_plus_some);
Seek could be a pita, unless you're talking about a really big file.
David