map{} is a wrong idea if the output isn't being used.Why? We use functions and operators without using their output all the time (print for instance). What makes map special that's not using its return value is a sin?
I didn't know about that. When did this performance enhancement happen?6 years ago (5.8.1). After many years of people using the performance penalty of map-in-void-context as an argument not to use map in void context, someone actually produced a one line patch to eliminate that. Didn't stop people from ranting against using map-in-void-context though. Didn't even stop people using the performance argument either.
Besides, wasn't it Larry himself who said that using things in other ways than originally intended isn't bad in itself? That one can enjoy sex, even if you aren't using it to reproduce yourself?
In reply to Re^4: Map Vs Foreach
by JavaFan
in thread Map Vs Foreach
by perlCrazy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |