Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: Replacing string with regexp without using modules

by almut (Canon)
on Aug 06, 2008 at 01:58 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://702537]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (1)
As of 2024-04-25 01:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found