in reply to Problem with children (out of conrol forking vs. zombies)
Ripped off from my column about stuff like that.use POSIX qw(WNOHANG); while ((my $kid = waitpid(-1, WNOHANG)) > 0) { warn "$kid reaped\n" if $trace; delete $kids{$kid}; }
The best way is to simply do this polling at some opportune time in your main loop, since having it in a signal handler will break eventually.
-- Randal L. Schwartz, Perl hacker
|
|---|