title: How do I search and replace across multiple lines with Perl?
body: <pre><code>$ perl --version
  This is perl, v5.10.1 (*) built for x86_64-linux-gnu-thread-multi
  
  $ echo -e "foo\nbar" &gt; baz.txt
  $ perl -p -e 's/foo\nbar/FOO\nBAR/m' baz.txt
  foo
  bar
  </code></pre>
  
  <p>How can I get this replacement to work?</p>