Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: Replacing string with regexp without using modules

by almut (Canon)
on Aug 06, 2008 at 01:58 UTC ( #702537=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $hash{a} = "go";
    $string =~ s{\$(\w+)}{$hash{$1}}ge;
    
  2. or download this
    $hash->{a} = "go";
    $string =~ s{\$(\w+)}{$$hash{$1}}ge;
    
  3. or download this
    $hash->{a} = "go";
    $string =~ s{\$(\w+)}{$hash->{$1}}ge;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2014-07-29 07:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (211 votes), past polls