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);
Jenda
Support Denmark!
Defend the free world!
Comment on
Re: What’s the best way to get the last N elements of a Perl array?
Download
Code
In Section
Seekers of Perl Wisdom