Thank you for your note, but could you please explain why using map in void context is "a wasteful"? Is it a problem of code performance and/or optimization?
TIA, marcos | [reply] |
I believe it is/was wasteful because of the list that map
builds to return to you. The normal use of map is like this:
my @returned = map BLOCK LIST;
In order to fill up @returned, map has to build a list.
If you're not going to be using that list (if you're using
map in void context), you've wasted that storage and the
processing time needed to allocate that memory.
However, I've read bits and pieces of this discussion
in the past, and I had thought that this list-building
was optimized away when map is used in a void context.
Is this the case, or was that merely a suggestion? :) | [reply] [d/l] |