use strict; use Data::Dumper; my @A1 = qw(a b c d e f g); my $n = 2; my @A2 = splice @A1, @A1-$n, $n; print Dumper [\@A1, \@A2]; __END__ $VAR1 = [ [ 'a', 'b', 'c', 'd', 'e' ], [ 'f', 'g' ] ];