my @foo = (1 .. 154); my @bar; while ( my @sp = splice @foo, 0, 30 ) { push @bar, \@sp; } foreach my $zub (@bar) { print "@{$zub}\n"; }