in reply to list to LoL

Untested, but....
sub lolize { my ($size, $inarrayref)= @_; my $count=0; my @temparray=(); my @returnarray=(); foreach (@$inarrayref){ push @temparray, $_; $count++; if($count==$size){ print @temparray, "\n"; push @returnarray, [@temparray]; @temparray=(); $count=0; } } return [@returnarray]; }
You'd call it with &lolize($count, $listref);