title: losing children in a fork
body: <pre><code>use strict;
  use warnings;
  use Parallel::ForkManager;
  
  my $log = "/scripts/downloads/test.log";
    print "Check the $log file\n" and open(LOG,"&gt;$log");
     *STDERR = *LOG;
    *STDOUT = *LOG;
  
  my $pmm=new Parallel::ForkManager(9);
  
  my @arr=(1..200);
  for(@arr){
  
  $pmm-&gt;start and next; # do the fork
  print $_."\n";
  $pmm-&gt;finish; # do the exit in the child process
  }
  
  $pmm-&gt;wait_all_children;
  
  open(READ,"$log") or die $!;
  my @check=&lt;READ&gt;;
  
  print "there are ".scalar @arr ." items....";
  print "but we only got ".scalar @check." items\n";
  </code></pre>
  
  <p>This is a simplified version of a script I have going.
  In this case, everytime I use more than 9 children I lose anywhere from 3-15 children, sometimes more. The obvious answer is to use less children but in my "real" script if I use less children the script will take many more hours to complete...time we don't have. Why is it losing children and is there a way to "capture" them and re-run them if they don't get run?</p>
  
  <p>thx!</p>