title: perl open: how to forward stderr to stdout?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/109124/how-do-you-capture-stderr-stdout-and-the-exit-code-all-at-once-in-perl">How do you capture stderr, stdout, and the exit code all at once, in Perl?</a><br>
    <a href="https://stackoverflow.com/questions/9132804/capturing-the-output-of-stderr-while-piping-stdout-to-a-file">Capturing the output of STDERR while piping STDOUT to a file</a>  </p>
  </blockquote>
  
  
  
  <p>I am using the following piece of code to execute a process:</p>
  
  <pre><code>open( my $proch, "-|", $command, @arguments );
  </code></pre>
  
  <p>Unfortunately, I will just read the <em>stdout</em>. But I'd like to read the <em>stderr</em> as well.</p>
  
  <p>Stderr redirection leads to the following error:</p>
  
  <pre><code>open( my $proch, "2&gt;&amp;1 -|", $command, @arguments );
  &gt;&gt;&gt; Unknown open() mode '2&gt;&amp;1 -|' at file.pl line 289
  </code></pre>
  
  <p>How can I forward <em>stderr</em> to <em>stdout</em>?</p>