title: How can I store the result of a system command in a Perl variable?
body: <pre><code>$ cat test.pl
  my $pid = 5892;
  my $not = system("top -H -p $pid -n 1 | grep myprocess | wc -l");
  print "not = $not\n";
  $ perl test.pl
  11
  not = 0
  $
  </code></pre>
  
  <p>I want to capture the result i.e. <code>11</code> into a variable. How can I do that?</p>