in reply to Re^3: Open Filehandle once
in thread Open Filehandle once
"map in void context is no longer expensive. map is now context aware, and will not construct a list if called in void context."
Hi Ken, I wasn't referring to "throwing away the output" in terms of wasted resources, but rather in terms of unclear code.
map is a function that returns a list -- when it is used in void context it smells bad, because it forces the reader to double-check that the author didn't make a mistake, falling into the same general category as any other distracting syntax or idiom.
It's also a bad habit in general to use functions for their side effects, as those may change.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Open Filehandle once
by kcott (Archbishop) on Aug 26, 2017 at 15:57 UTC |