title: perl s/this/that/r ==> "Bareword found where operator expected"
body: <p><a href="http://perldoc.perl.org/perlop.html" rel="nofollow noreferrer">Perl docs</a> recommend this:</p>
  
  <pre><code>$foo = $bar =~ s/this/that/r;
  </code></pre>
  
  <p>However, I get this error:</p>
  
  <pre><code>Bareword found where operator expected near
      "s/this/that/r" (#1)
  </code></pre>
  
  <p>This is specific to the <code>r</code> modifier, without it the code works.
  However, I do not want to modify <code>$bar</code>.
  I can, of course, replace </p>
  
  <pre><code>my $foo = $bar =~ s/this/that/r;
  </code></pre>
  
  <p>with</p>
  
  <pre><code>my $foo = $bar;
  $foo =~ s/this/that/;
  </code></pre>
  
  <p>Is there a better solution?</p>