my @t = (qw( a b c e 1 2 3 4 5 3 f )); my $len = 3; my @u = map {[ @t[$_ .. $_+$len-1] ]} grep {!($_%$len)} 0 .. $#t;