in reply to Re: Map Vs Foreach
in thread Map Vs Foreach
Only if you assign the return value of map to an array, and you have the same array as input list to the map, one could say that map 'transforms' a list. But then it's the combination of map and the assign statement.
The only way I can think of map on its own "transforming" a list is constructs like:
But for knows that trick as well:map {$_ = ucfirst} @array;
for (@array) {$_ = ucfirst}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Map Vs Foreach
by ikegami (Patriarch) on Nov 26, 2009 at 22:59 UTC | |
by JavaFan (Canon) on Nov 27, 2009 at 09:36 UTC | |
by ikegami (Patriarch) on Nov 27, 2009 at 16:12 UTC | |
|