title: How to use Perl to merge multi-line into single line
body: <p>I try to use Perl to covert from the input text file format to the output text file format shown, but not successfully.</p>
  
  <p>Can anyone help?</p>
  
  <p>Input:</p>
  
  <pre><code>row1 multiline 1
  row1 multiline 2
  row1 multiline 3
  row2 multiline 1
  row2 multiline 2
  </code></pre>
  
  <p>Expected Output:</p>
  
  <pre><code>row1 multiline 1 multiline 2 multiline 3
  row2 multiline 1 multiline 2
  </code></pre>