title: Inconsistency between perl grep and cli grep
body: <p>I am doing the following:  </p>
  
  <pre><code>#!/usr/bin/perl  
  use strict;  
  use warnings;  
  
  my $proc = `ps -ef|grep -c myscriptname`;  
  print $proc;  
  </code></pre>
  
  <p>This prints 2 when I run it inside the script.  </p>
  
  <p><code>ps -ef|grep -c myscriptname</code> on the command line just shows:  1<br>
  Why?  </p>
  
  <p>same for <code>my $proc = qx/ps -ef|grep -c myscriptname/</code>  </p>
  
  <p><strong>UPDATE</strong><br>
  To be clear I run this snippet from <code>somerandomscript.pl</code>  </p>
  
  <p><strong>Update 2</strong><br>
  Following the advice of edorqui I remove <code>-c</code> getting:   </p>
  
  <pre><code>12013 15777 15776 0 14:11 pts/6 00:00:00 sh -c ps -ef | grep myscriptname   
  12013 15779 15777 0 14:11 pts/6 00:00:00 grep myscriptname Argument "12013 15777 15776 0 14:11 pts/6 00:00:00 sh -c ps..." isn't numeric in numeric gt (&gt;) at somerandomscript.pl line 8  
  </code></pre>
  
  <p>from inside the script</p>