in reply to loop thru 3-element array?
In my own version of List::Util I have this subroutine:
For your example, it would be used assub group { my $n = shift; map [ @_[$_*$n .. $_*$n + $n - 1] ] => 0 .. $#_ / $n; }
for (group(3, @dynval3)) { my ($newname, $name, $val) = @$_; ... }
ihb
Read argumentation in its context!
|
|---|