in reply to Check if forked process is dead

I think the answer to the original question is even simpler:
if( $pid ){ # we are the parent: sleep 3; say kill 0 => $pid; waitpid $pid => 0; } else { # we are the child: exit; }
The child immediately does an "exit" - so where's the mystery?

One world, one people