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

Regex substitution modifier /r

by nonsequitur (Monk)
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 line 2, near "s/dogs/ca
    syntax error at line 2, near "s/dogs/cats/r"

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1008916]
Approved by toolic
[davido]: Lol, in composing test code for Re: Stupid, yet simple, sort question I managed to fill up /tmp for a moment, causing bash to complain about "pmbash: cannot create temp file for here-document: No space left on device"
[davido]: hm, sorry, wrong link: Re^3: Perl Program to efficiently process 500000 small files in a Directory (AIX) should be it.

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2018-03-18 06:55 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (228 votes). Check out past polls.