in reply to Re: Re: Fold a list using map splices
in thread Fold a list using map splices
I'm not saying that my approach is the sole possible correct one, but I do believe that yours is wrong. The way it turns out to work is more of an accidental feature than something you should rely on.
If you really don't want to create a temporary array, I suggest you do something like
Iterating the map over an array while modifying it at the same time is wrong.map func1([ splice @_, 0, $num_elements ]), 0 .. (@_/$num_elements);
Makeshifts last the longest.
In Section
Cool Uses for Perl