Thanks to some other great posts here (like this and that), I have several reliable methods to background a process in a Perl script.
However, in my environment (IIS6 on Windows Server 2003), it doesn't seem to completely background. Take this script:
use CGI::Pretty qw(:standard);
print header;
print start_html;
print "hi<br>";
system(1,qw(sleep 10));
print "bye";
print end_html;
The browser will stay "connected" for 10 seconds while the sleep process runs. "hi" and "bye" will both be printed on the screen, but the browser seems to be waiting for something more from the server (Firefox 4's and IE6's progress bars keep moving slowly for those 10 seconds).
I'd like the user (for my real app) to believe the process is fully back-grounded and be fully comfortable being able to close the webpage. With the progress bar still moving, I'm sure they'll sit and wait for it to stop before they close it or navigate away.
Just to be clear - the process appears backgrounded. I can close the web browser. The real background job continues to run (sometimes for up to an hour) with no issues. I'd just like to clean this up from the UI perspective.
Thanks!