title: Using grep within perl script and piping output to different files
body: <p>I want to open a list of identifiers and find matches in another file. For this I used grep as a system function with a per script. But i am not sure where i am going wrong. Could you please help me out with the syntax? Thank you for your time!</p>
  
  <pre><code>open F, "$ARGV[0]" or die;
  while(&lt;F&gt;)
  {
      `grep -A1 "$_" CAM_PROJ_BATS.read.fa &gt; $_.txt`;
  } 
  </code></pre>