kleinbiker7 has asked for the wisdom of the Perl Monks concerning the following question:
But it doesnt. The child does his thing, but the stupid parent keeps waiting for the child to finish.
Anyway, here is my code sample:
# %form is a hash that contains all the values # that the person entered on the form. It is global # IF THE USER SELECTED EMAIL..DO THIS CODE if ($form{attachme} eq "yes") { $query =~ s/(and|or)$//; # Strip off trailing AND/OR my ($values, $pid); if ($pid = fork) { # Send the data by email if option selected # The 'Search Was Successful' note has been moved to # the correct directory on the hard drive # and the script redirects the user to that page. # This is to stop HTTPD from hanging. # users'printvtml is just like vtml'printvtml, EXCEPT that the # Content Type text/html line has been replaced with a Locatio +n header # to redirect the user to the note saying that the email has b +een sent. $form{-nextpage} = "/admin/users/reports/mailview.vtml"; # This is a function that we use to print to the screen. # It is not causing this problem. &users'printvtml($URLPREFIX."$form{-nextpage}",\%form,\%script +); exit (0); } elsif (defined $pid) { # CHILD PROCESS GOES HERE if ( $form{which} eq "custom" ) { $values = $form{retval}; } elsif ( $form{which} eq "all" ) { $values = $form{allval}; } exec ("perl $fork_to $form{sendto} \"$query\" $values"); exit (0); } exit (0); }
Edit by tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do you tell the parent process to stop it's HTTP transfer, when it forks off a child process?
by suaveant (Parson) on May 30, 2001 at 17:37 UTC | |
|
Re: How do you tell the parent process to stop it's HTTP transfer, when it forks off a child process?
by shotgunefx (Parson) on May 30, 2001 at 17:44 UTC | |
|
Re: How do you tell the parent process to stop it's HTTP transfer, when it forks off a child process?
by Anonymous Monk on May 31, 2001 at 02:05 UTC | |
|
Re: (petethered) How do you tell the parent process to stop it's HTTP transfer, when it forks off a child process?
by Anonymous Monk on May 31, 2001 at 05:18 UTC | |
by petethered (Pilgrim) on May 31, 2001 at 05:20 UTC |