title: Best way to capture output from system command to a text file?
body: <p>I’m trying to capture output from using Perl’s <code>system</code> function to execute and redirect a system command’s ouptut to a file, but for some reason I’m not getting the whole output.</p>
  
  <p>I’m using the following method:</p>
  
  <pre><code>system("example.exe &gt;output.txt");
  </code></pre>
  
  <p>What’s wrong with this code, or is there an alternative way of doing the same thing?</p>