in reply to Dividing an array into multiple parts

Could you supply the code you wrote?

I wrote this:

use Data::Dumper; use POSIX; @a = (1..100); @b = (1..8); @new_a = (); $maxelmts = POSIX::ceil(scalar @a / scalar @b); $i = 0; foreach (@b) { push @new_a, [grep { defined } @a[$i..($i+$maxelmts)]]; $i += $maxelmts; } print Dumper \@new_a;

Igor 'izut' Sutton
your code, your rules.