my $fh = $pids{$key}{'fh'}; while (<$fh>){print $_}
This kind of thing will work fine until your sub-processes need to produce more than 4k of data (or whatever your buffer size is). Then the sub-procs will block when they print() and won't work in parallel while you're collecting results. To fix this you need to switch to using something like IO::Select or EV to pull data from each process as it's ready.
-sam
In reply to Re^2: Fork and wait question
by samtregar
in thread Fork and wait question
by chris68805
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |