my $pid = fork; if (defined $pid and !$pid) { exec "test2.pl"; exit(0); # just in case exec fails! }