use POSIX qw( :sys_wait_h ); $SIG{CHLD} = \&REAPER; sub REAPER { my $kid; while (($kid = waitpid (-1, &WNOHANG)) > 0) { if (exists $Children{$kid}) { $::logger->info ("Process: $Children{$kid} reaped"); $children --; delete $Children{$kid}; } } $SIG{CHLD} = \&REAPER; }