# And maintain the population. while ((my $pid = waitpid(-1)) > 0) { $children--; delete $children{$pid}; make_new_child() }