in reply to Re^3: stack array to array of arrays
in thread stack array to array of arrays
My problem is that it requires a lot of extra includes...use feature 'state'; use List::MoreUtils qw(part); ... print oxTable->new([ part { state $i++ / $len } @array ]);
sub arrayStack { my $len= pop; return map [splice @_,0,$len], 0..$#_/$len; } ... print oxTable->new([ arrayStack(@array,$len) ])
But it was a worthy exercise.... I actually never thought to use a counter as the inputted array and splicing off of the named array.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: stack array to array of arrays
by LanX (Saint) on Oct 17, 2013 at 17:57 UTC |