in reply to Round robin processing
if consecutive elements and destroying the original array are OK, try splice
DB<32> use Data::Dump qw/dd/ DB<33> @a=1..12; dd { map { $_ => [splice @a,0,3] } 1..4 } { 1 => [1, 2, 3], 2 => [4, 5, 6], 3 => [7, 8, 9], 4 => [10, 11, 12] } +...
NB: the case where @a/4 is not an integer is more complicated.
HTH! :)
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
|
|---|