Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

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

Comment on Re^2: Using regex in Map function
Download Code

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 about the Monastery: (5)
As of 2015-11-28 16:47 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (743 votes), past polls