title: How do I replace multiple newlines with a single one with Perl's Regular Expressions?
body: <p>I've got a document containing empty lines (\n\n). They can be removed with sed:</p>
  
  <pre><code>echo $'a\n\nb'|sed -e '/^$/d'
  </code></pre>
  
  <p>But how do I do that with an ordinary regular expression in perl? Anything like the following just shows no result at all.</p>
  
  <pre><code>echo $'a\n\nb'|perl -p -e 's/\n\n/\n/s'
  </code></pre>