title: Executing shell command with pipe in perl
body: <p>I want the output of the shell command captured in variable of a perl script, only the first section of the command before the pipe "|" is getting executed, and there is no error while executing the script</p>
  
  <pre><code>File.txt 
  Error input.txt got an error while parsing 
  Info  output.txt has no error while parsing 
  
  my $var = `grep Error ./File.txt | awk '{print $2}'`;
  print "Errored file $var";
  </code></pre>
  
  <p>Errored file Error input.txt got an error while parsing</p>
  
  <p>I want just the input.txt which gets filtered by awk command but not happening. Please help</p>