Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
go ahead... be a heretic
 
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 romping around the Monastery: (6)
As of 2014-04-16 05:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (414 votes), past polls