Doh. Of course, map
during the expression, but the expression's result is completely separate. I updated my previous reply with a version that works. Returning a new value rather than just operating on an alias is the reason for the performance hit of course; unfortunately, I can only think of only two other remotely relevant aliasing constructs in Perl, neither of which are any help here: grep
returns aliases, and the @_
in a function call contains aliases rather than copies. I can't see how to use either to achieve something less awkward than a nested for
Makeshifts last the longest.