http://qs321.pair.com?node_id=237157


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
map func1([ splice @_, 0, $num_elements ]), 0 .. (@_/$num_elements);
Iterating the map over an array while modifying it at the same time is wrong.

Makeshifts last the longest.