Keep It Simple, Stupid | |
PerlMonks |
Re^3: Fold a list using map splicesby Aristotle (Chancellor) |
on Feb 20, 2003 at 17:54 UTC ( [id://237157]=note: print w/replies, xml ) | Need Help?? |
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. Makeshifts last the longest.
In Section
Cool Uses for Perl
|
|