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

Regex substitution modifier /r

by nonsequitur (Scribe)
on Dec 15, 2012 at 00:25 UTC ( #1008916=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $x = "I like dogs.";
    $y = $x =~ s/dogs/cats/r;
    print "$x $y\n"; # prints "I like dogs. I like cats."
    
  2. or download this
    Bareword found where operator expected at r.pl line 2, near "s/dogs/ca
    +ts/r"
    syntax error at r.pl line 2, near "s/dogs/cats/r"
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2014-10-24 13:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (131 votes), past polls