if( $pid ){ # we are the parent: sleep 3; say kill 0 => $pid; waitpid $pid => 0; } else { # we are the child: exit; }