It is only the artifact of using @_ in the sub call which avoids the copy.my @copy = @$r; while( @copy ) { push @$r2, [ shift @copy, shift @copy ]; }
In reply to Re: Processing arrays 2 elements at a time (TIMTOWTDI)
by petral
in thread Processing arrays 2 elements at a time (TIMTOWTDI)
by grinder
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |