title: How do I perform multiple replacements with Perl?
body: <p>I have Perl code:</p>
  
  <pre><code>my $s =  "The+quick+brown+fox+jumps+over+the+lazy+dog+that+is+my+dog";
  </code></pre>
  
  <p>I want to replace every <code>+</code> with space and <code>dog</code> with <code>cat</code>.</p>
  
  <p>I have this regular expression:</p>
  
  <pre><code>$s =~ s/\+(.*)dog/ ${1}cat/g;
  </code></pre>
  
  <p>But, it only matches the first occurrence of <code>+</code> and last <code>dog</code>.</p>