Last line of file/Perl

Página superior
Adjuntos:
Obtener este mensaje como un correo
+ (text/plain)
Eliminar este mensaje
Responder a este mensaje
Autor: David A. Sinck
Fecha:  
Asunto: 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