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)

Hi, new questions go in Seekers Of Perl Wisdom because

grinder, whom you asked a question, hasn't been here in 2 years.

The node to which you replied is 9 years old.

Welcome, see The Perl Monks Guide to the Monastery, see How do I post a question effectively?, Where should I post X?

Now , regarding your code, I recommend you read grinders meditation until it starts making sense. Reading the whole file into memory will work for small files only. I might write the same code as

for my $index ( 1 .. 12 ){ my $line = $lines[ - $index ]; }
  • Comment on Re^2: Performing a tail(1) in Perl (reading the last N lines of a file)
  • Download Code