This shouldn't be difficult, but I have to admit that I'm stumped with this one and would appreciate any advice.<br><br>I'm working on a form so that someone can submit data, it gets saved to a file, and the user gets a nice little thank you screen that goes into a redirect mode until a forked process completes its analysis of the data.
<br><br>The problem I'm hitting is that the parent process seems to hang around and won't invoke the meta redirect until the exec in the child is done.&nbsp; This doesn't make sense to me.<br><br>Here is the snippet:<br><br>#!/usr/bin/perl
<br>use CGI qw(:standard);<br><br>if (param('submit') ne '') {<br>&nbsp;&nbsp; my $seq = param('seq');<br>&nbsp;&nbsp; # $seq gets cleaned up and saved out to a specific location<br><br>&nbsp;&nbsp; # fork submitted, start redirecting for polling for results
<br>&nbsp;&nbsp; print header, &quot;&lt;html&gt;&lt;head&gt;&quot;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; qq~&lt;META HTTP-EQUIV=&quot;Refresh&quot; CONTENT=&quot;0;URL=PATH_TO_POLLING_FOR_RESULTS_PROGRAM?refresh=1&quot;&gt;~,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;&lt;/head&gt;&lt;body&gt;&lt;h2&gt;Sequence Submitted!&lt;/h2&gt;Redirecting ...&lt;/body&gt;&lt;/html&gt;\n&quot;;
<br><br>&nbsp;&nbsp; # double-fork trick because of zombies (got this from some web searching)<br>&nbsp;&nbsp; unless ($pid = fork) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unless (fork) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exec(&quot;PATH_TO_ANALYSIS_PROGRAM&quot;, &quot;0041&quot;);&nbsp; # 0041 is a hard coded ARG value for now
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit(0);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit(0);<br>&nbsp;&nbsp; }<br><br>&nbsp;&nbsp; # fork submitted, start redirecting for polling for results<br>&nbsp;&nbsp; exit(0);<br>}<br><br>Thank you.<br><br>- Glenn<br><br>