Fork Perl CGI sub into background and wait for it to finish.
Posted on 2007-09-28
I have a Perl CGI script and I have sub that I'm calling that takes a very long time to run. It takes so long that the web browser times out and the process dies before it finishes.
I need to fork this sub routine into the background somehow, then display a page that says something like 'processing...' and this page keeps refreshing and checking to see if the process has completed.
1. How can I push a perl subroutine into the background so it will run to completion.
2. How can I check to see if the background process has completed?
3. Need to do all of this for CGI web app.