in reply to Problem with children (out of conrol forking vs. zombies)

You will get one SIGCHLD for any appearance of one or more kids. You have to reap kids until there are no kids to reap. Something like this:
use POSIX qw(WNOHANG); while ((my $kid = waitpid(-1, WNOHANG)) > 0) { warn "$kid reaped\n" if $trace; delete $kids{$kid}; }
Ripped off from my column about stuff like that.

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