Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: change all occurances of string1 into string2

by choroba (Chancellor)
on Nov 29, 2012 at 15:29 UTC ( #1006277=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    s/$thing/$translate{$thing}/g;
    
  2. or download this
    my $re = join '|', keys %translate;
    $re = qr/($re)/;
    ...
        s/$re/$translate{$1}/g;
        print;
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2016-07-26 21:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (240 votes). Check out past polls.