in reply to String to two dimensional array

Yet another way, using List::MoreUtils:

use List::MoreUtils qw( natatime ); $_ = '0 X X X X X X X X 1 X X X X X X X X 2 X X X X X X X X 3 X X X X +X X X X 4 X X X X X X X X 5 X X X X X X X X 6 X X X X X X X X 7'; my @a = split; my $it = natatime(8,@a); while (my @v = $it->()) { print "@v\n"; }

Converting that into an appropriately parameterized function is an exercise left for... you. ;-)

A word spoken in Mind will reach its own level, in the objective world, by its own weight