Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re^2: Using regex in Map function

by strat (Canon)
on May 03, 2007 at 09:57 UTC ( #613337=note: print w/replies, xml ) Need Help??

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."

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://613337]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2016-10-23 17:32 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (301 votes). Check out past polls.