my $pid = fork(); my $report; if (not defined $pid) { $report = "We were unable to process your file.\n"; warn "$0: $!\n"; # put something in the web server errlog } elsif ($pid == 0) { # child process: launch the other executable open STDOUT, ">>", "/some/path/myfile.log"; open STDERR, ">>", "/some/path/myfile.err"; exec("/usr/local/bin/launch myfile"); } else { # parent process: report the child process was launched $report = "Your file has been sent successfully. You will be notified via email once it has been completed. Thank you."; } print $report, end_html();