All:
I have a CGI script which forks off a new process to perform lengthy
operations, and then uses the parent to display a short message in
the browser indicating that the process has begun.
However, I'm finding that the browser tries to continue loading until
the child has completed. How can I stop this (or can I?) I want the
parent to print the message and exit, but the browser waits for the
child anyway... UGH...
use strict;
use CGI qw(:all);
$|++;
my $pid = fork;
if ($pid == 0) { # CHILD
sleep 30;
# Do stuff that takes a long time.
exit;
}
print header;
print start_html;
print "<h1>Running command. Thanks.</h1>\n";
exit;
I'm guessing I need to send some special kind of headers to the server
or something, but I really haven't a clue. Any ideas?
Thanks,
-Mike