I strictly reserve map for coercion of a set of FOO items into a set of BAR items (@lista -> map -> @listb), for/foreach for iteration (do_something for @list), and while for terminating on a condition (do_something while sometest()). I don't use map unless I am consistently transforming ALL (typically) of the original items to the new set, although I may combine it with a leading grep if I only want a subset.
--MidLifeXis
In reply to Re: map vs for\foreach.
by MidLifeXis
in thread map vs for\foreach.
by builat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |