loody wrote:
> 
> I try to read the last line of a file directly instead of using
> while(<>) or something else to read each line until "undef" bumped to
> me.
> If you know some build-in functions or another modules for me to use,
> please help me.

Like this. Both Fcntl and Tie::File are standard modules.

HTH,

Rob



use strict;
use warnings;

use Fcntl;
use Tie::File;

tie my @file, 'Tie::File', 'filename', mode => O_RDONLY or die $!;
print $file[-1];

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to