in reply to Extracting numbers from arrays

Just to add another idea of how to do it...
@a=qw(1 2 3 4 5 6 7 8 9 2 3 1 4 5 6 7 8 9 1 4); $first=3; $last=1; @l{@a}=0..$#a; @f{reverse @a}=reverse 0..$#a; print join ' ',@a[$f{$first}..$l{$last}],"\n";
This solves the problem by storing the first and last index of each number in %f and %l. Then you can get the whole slice between both numbers.

Maybe you want to use

@a[$f{$first}..$l{$last}>=$f{$first}?$l{$last}:$#a]
to get the complet rest of the array if the last number isn't behind the first.