You'd call it with &lolize($count, $listref);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]; }
In reply to Re: list to LoL
by swiftone
in thread list to LoL
by princepawn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |