in reply to Re: Fork and wait question
in thread Fork and wait question

Calling close on the file handles will also wait for the processes to complete.

Replies are listed 'Best First'.
Re^3: Fork and wait question
by chris68805 (Initiate) on Jun 12, 2008 at 18:41 UTC
    Where do you put the close for the file handlers?
      Use it instead of the waitpid call:
      foreach my $key(keys %pids){ close $pids{$key}{'fh'}; }