{ local $SIG{CHLD} = 'IGNORE'; ... launch child ... if (sleep(20)) { kill(KILL => $child_pid); # Wait for child to die before restoring $SIG{CHLD}. # Unlikely race condition. while (kill(0, $child_pid)) { sleep(1) or last; } } }