c:\@Work\Perl\monks>perl -wMstrict -e "my @stack = ( 'line 1', 'line two', 'third line', 'line the fourth', 'almost there', 'last line', ); ;; my $n = 3; ;; print qq{$_ \n} for @stack[ -$n .. -1 ]; " line the fourth almost there last line #### c:\@Work\Perl\monks>perl -wMstrict -e "my @stack = ( 'line 1', 'line two', 'third line', 'third from last', 'almost there', 'last line', ); ;; my $n = 3; ;; print qq{$_ \n} for reverse @stack[ -$n .. -1 ]; " last line almost there third from last