in reply to Round robin processing

Hello llarochelle

you can also use a boustrophedon distribution:

use Data::Dump my @A = (1..12); my $data; my $i = 0; while (@A){ push @{$data->[$i]},shift @A; $i == 3 ? $i = -1 : $i == -4 ? $i = 0 : $i < 0 ? $i-- : $i +++; } dd $data; __DATA__ [ [1, 8, 9], [2, 7, 10], [3, 6, 11], [4, 5, 12] ]

See also How to get this not the usual round robin looping for more examples about such distribution

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.