in reply to What’s the best way to get the last N elements of a Perl array?

Hi,

add
@last_n = grep { defined($_) } @last_n;
and it will work - given that there were no undef elements in the array that you want to keep
Regards,
svenXY
  • Comment on Re: What’s the best way to get the last N elements of a Perl array?
  • Download Code