my $pid; if (!defined ($pid = fork)) { die "Unable to fork: $!"; } elsif (! $pid) { # this is the branch for the child process # do stuff in the child process exit; # terminate the child process }