use Data::Dumper; my $step = 5; my @array = ('a'..'z'); print Dumper [ map[ @array[$_..$_+$step-1] ], range(0,$#array,$step) ];