title: Problem with perl multiline matching
body: <p>I'm trying to use a perl one-liner to update some code that spans multiple lines and am seeing some strange behavior.  Here's a simple text file that shows the problem I'm seeing:</p>
  
  <pre><code>ABCD    START
           STOP    EFGH
  </code></pre>
  
  <p>I expected the following to work but it doesn't end up replacing anything:</p>
  
  <pre><code>perl -pi -e 's/START\s+STOP/REPLACE/s' input.txt
  </code></pre>
  
  <p>After doing some experimenting I found that the <code>\s+</code> in the original regex will match the newline but not any of the whitespace on the 2nd line, and adding a second <code>\s+</code> doesn't work either.  So for now I'm doing the following workaround, which is to add an intermediate regex that only removes the newline:</p>
  
  <pre><code>perl -pi -e 's/START\s+/START/s' input.txt
  </code></pre>
  
  <p>This creates the following intermediate file:</p>
  
  <pre><code>ABCD    START            STOP    EFGH
  </code></pre>
  
  <p>Then I can run the original regex (although the <code>/s</code> is no longer needed):</p>
  
  <pre><code>perl -pi -e 's/START\s+STOP/REPLACE/s' input.txt
  </code></pre>
  
  <p>This creates the final, desired file:</p>
  
  <pre><code>ABCD    REPLACE    EFGH
  </code></pre>
  
  <p>It seems like the intermediate step should not be necessary.   Am I missing something?</p>