If we were doing 10 different things to the items in @foo, and some of them depended on what the individual item was, it would be inelegant to use map, and more elegant to use foreach.Why?
Isn't that elegant, too?@foo = map { super_complicated_transform ($_) } @foo; sub super_complicated_transform { #stuff goes here }
In reply to Re: How do you define "elegant"?
by holli
in thread How do you define "elegant"?
by Mutant
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |