if (!defined($pid = fork())) { # FAILURE # parent process } elsif ($pid == 0) { # SUCCESS # child process } else { # SUCCESS # parent process }