Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
What appears to happen is that the script does actually fork but it does not redirect to the webpage when I want it to and as it takes so long, it times out. First thing I want to fix is getting the webpage to display prior to the script forking. There are some other issues in that the forking process seems not to wait for the results of subroutines in the processing code section. I am processing email addresses and run an nslookup on addresses. I'm a little confused as to what might be happening after the forking statement? Maybe someone could shed some enlightened advice on this problem?open UPLOAD, ">$tmp_file"; while ( <$upload_file> ) { print UPLOAD; } close UPLOAD; print "Location: my_webpage_goes_here.htm\n\n"; my $pid = fork; $pid = 0 unless defined $pid; # be the kid if fork failed exit 0 if $pid; processing code on file goes here including subroutine to perform nslookup to verify email address &VerifyEmailAddress($email); my $mailprog = '/usr/sbin/sendmail'; open(MAIL,"|$mailprog -t"); sending email code goes here
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Redirecting to a webpage in a script before forking to code in a script
by dws (Chancellor) on May 28, 2002 at 19:37 UTC | |
|
Re: Redirecting to a webpage in a script before forking to code in a script
by Abigail-II (Bishop) on May 29, 2002 at 09:34 UTC |