in reply to Re: Performing a tail(1) in Perl (reading the last N lines of a file)
in thread Performing a tail(1) in Perl (reading the last N lines of a file)

Says broquaint:
I'm not sure how this benchmarks, but it is a little more succinct ;-)
use Tie::File; ... print @file[$#file - $length + 1 .. $#file];
It should benchmark OK, although not as well as a special-purpose backward-file-reader. But I agree with you about the succinctness. I mostly followed up to point out that you can do even better:
print @file[-$length .. -1];
Hope this helps.

--
Mark Dominus
Perl Paraphernalia