title: Why can't I get the output of a command with system() in Perl?
body: <p>When executing a command on the command-line from Perl, is there a way to store that result as a variable in Perl?</p>
  
  <pre><code>my $command    = "cat $input_file | uniq -d | wc -l";
  my $result     = system($command);
  </code></pre>
  
  <p><code>$result</code> always turns out to be 0.</p>