if ( my $pid = fork() ) { # parent } else { die "Can't fork: $!" if ( ! defined $pid ); # child }