http://www.perlmonks.org?node_id=613337


in reply to Re: Using regex in Map function
in thread Using regex in Map function

If you need something like the copy - do something more often, you could also create a copy-wrapper for map, let's call it cwmap:

sub cwmap( &@ ) { map { local $_ = $_; # create copy $_[0]->(); # execute code-block $_; # copied element } @_[ 1..$#_ ]; # list } # cwmap # and then use it like map: @new = cwmap { s/$_/$_,hi/ } <TEST>;

Best regards,
perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"