http://qs321.pair.com?node_id=639908

adrive has asked for the wisdom of the Perl Monks concerning the following question:

looks like i need help from the monks again :(
is there a function out there for perl array that enables me to split my array like every 5 elements? say like..
my @myArray = (1..100); my @myMainArray = (); my $c = 1; foreach (@myArray){ if(c++ = 5){ #1.some splitting occurs and assign to a 5 element array #2.push 5 element array into main array #3.reset c = 1; } }
then at the end i'll be able to construct a nested loop that could extract them out like
my @myArrayResult = @myMainArray; foreach my $o(@myArrayResult){ foreach my $i($o){ #print out } }