my $pid; if( $pid = fork ) { check_1(); } elsif ( defined $pid ) { check_2(); }