in reply to Re^2: map in void context
in thread map in void context
So, you'd prefer to avoid assignment,
I don't know what side effects you are talking about for assignments.
print statements,
I'm not fond of how print changes $!, but it's much more convenient than the alternative. There's also a very high level of consistency with other like functions. system is where it goes overboard ($?).
regular expressions,
I don't use $1, etc. I use the match operator in list context instead.
and even fetching the value of a variable?
Memoizing is a harmless side-effect.
I see as many side-effects as the code using 'for'
As I see it,
The purpose of for is to affect something (necessarily external) repeatedly.
The purpose of map is to transform a list.
You may see things differently, but it was clear that I was explaining how I see things.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
| A reply falls below the community's threshold of quality. You may see it by logging in. |