my $pid = fork(); if ($pid == 0) { # we're the child # exec something or other } else { sleep 10; # give the child a chance kill 1, $pid; # nighty-night }