sub group { my $n = shift; my @rv; push @rv, splice(@_, 0, $n) while @_; return @rv; }
That just returns a copy of the original list. You probably meant push @rv, [ splice(@_, 0, $n) ] while @_;.
In reply to Re^2: List into two-dimensional array
by haukex
in thread List into two-dimensional array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |