Last line of file/Perl

Startseite
Anhänge:
Nachricht
+ (text/plain)
Nachricht löschen
Nachricht beantworten
Autor: David A. Sinck
Datum:  
Betreff: 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