title: Loop Find Command's Output
body: <p>I'm wanting to issue the find command in Perl and loop through the resulting file paths. I'm trying it like so (but not having any luck):</p>
  
  <pre><code>my $cmd;
  
  open($cmd, '-|', 'find $input_dir -name "*.fastq.gz" -print') or die $!;
  
  while ($line = &lt;$cmd&gt;) {
     print $line;
  }
  
  close $cmd;
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>Thanks</p>