in reply to What’s the best way to get the last N elements of a Perl array?
use List::Util qw(max); @last_n = @source[max(0, @source - $n) .. $#source]; [download]
Update: Fixed offby1-error pointed out by AnomalousMonk++