title: Linux grep command in Perl script not working
body: <p>I have a grep command which works on Linux command prompt:
  <code>grep -Po 'rand_num=\K[^ ]*' log.txt</code>
  This command prints the number after <code>rand_num=</code> in my log.txt file.  But I need this command in perl script.  I tried</p>
  <pre><code>my $rand_number;
  $rand_number = system(&quot;grep -Po 'rand_num=\K[^ ]*' log.txt&quot;);
  print &quot;Random number = $rand_number&quot;;
  </code></pre>
  <p>But it doesn't work. I tried
  <code>$rand_number = `grep -Po 'rand_num=\K[^ ]*' log.txt`;</code>
  But that also didn't work</p>
  <p>Can someone tell what is mistake here and how got get it working?</p>