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 ]; }

In reply to Re^2: Performing a tail(1) in Perl (reading the last N lines of a file) by Anonymous Monk
in thread Performing a tail(1) in Perl (reading the last N lines of a file) by grinder

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":