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

@last_n = ($n < @source ? @source[(@source-$n)..$#source] : @source);
  • Comment on Re: What’s the best way to get the last N elements of a Perl array?
  • Download Code