title: How can I remove linebreaks with a Perl regex?
body: <p>when I run:</p>
  
  <pre><code>perl -e '$x="abc\nxyz\n123"; $x =~ s/\n.*/... multiline.../; printf("str %s\n", $x);'
  </code></pre>
  
  <p>I expect result to be:</p>
  
  <pre><code>str abc... multiline...
  </code></pre>
  
  <p>instead I get</p>
  
  <pre><code>str abc... multiline...
  123
  </code></pre>
  
  <p>Where am I going wrong?</p>