in reply to How do you define "elegant"?
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 }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do you define "elegant"?
by Mutant (Priest) on Aug 16, 2006 at 11:55 UTC | |
by holli (Abbot) on Aug 16, 2006 at 12:00 UTC | |
by Jenda (Abbot) on Aug 16, 2006 at 13:37 UTC | |
by ikegami (Patriarch) on Aug 16, 2006 at 17:50 UTC |