Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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

by heptadecagram (Novice)
on Mar 01, 2005 at 15:40 UTC ( #435480=note: print w/ replies, xml ) Need Help??


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

True. I'd like to see a switch:

my $modified = s/$pattern/$change_to/gr;

Where /r stands for 'replaced', or somesuch.


Comment on Re^3: Perl oddities (s/// doesn't DWIM in map)
Select or Download Code
Re^4: Perl oddities (s/// doesn't DWIM in map)
by Roy Johnson (Monsignor) on Mar 01, 2005 at 18:50 UTC
    Would that be equivalent to
    (my $modified = $_) =~ s/$pattern/$change_to/g;
    or
    s/$pattern/$change_to/g; my $modified = $_;
    ?

    Caution: Contents may have been coded under pressure.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2014-12-20 08:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (95 votes), past polls