if (my $pid = fork) { ## Parent } elsif (defined $pid) { ## Child } else { ## Error, $pid is undefined }