Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Perl oddities (s/// doesn't DWIM in map)

by Roy Johnson (Monsignor)
on Mar 01, 2005 at 20:18 UTC ( #435597=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @new = map { s/foo/bar/; $_ } @old;
    # @old is modified along with @new!
    # should be my @new = map { s/foo/bar/; $_ } map {$_} @old;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2019-11-12 16:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (66 votes). Check out past polls.

    Notices?