Last line of file/Perl

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: David A. Sinck
Date:  
Subject: Last line of file/Perl

\_ 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