my $rip_done = 0; $SIG{CHLD} = sub { $rip_done = 1; while( waitpid(-1, WNOHANG) > 0) {} };