in reply to RE: list to LoL
in thread list to LoL

Very true, but since you are dealing with a reference, splice would clobber your original list.

The code for a splice loop should look something like:

sub lolize{ my($size, $arrayref)=@_; my @returnarray=(); my $count=0; while($count<=$@arrayref){ push @returnarray, [splice(@$arrayref,$count, $count+$size-1)] +; $count+=$size; } return [@returnarray]; }
This is untested, so this might "fill-in" your array to fill in the last list. To correct that, you say:
push @returnarray, [splice(@$arrayref,$count, ($count+$size-1<=@$array +ref)? $count+size-1 :@$arrayref )];
Hmm. There are probably some fencepost errors and such when $size=1 and suchlike, but this should let you play with it.