Hello,
I have a question regarding the best way to run a background process in a web application using CGI and Perl. My best attempt currently forks a parent process which creates a dummy output page (that is set to auto-refresh) and then exits. The child is where I am doing all of my work in my script, and while I know it is rather unorthodox to force the parent to exit before the child, I couldn't figure out another way to accomplish backgrounding within my scripts.
The good part of this solution is that it works; the parent creates an auto-refreshing dummy page, and once the child is done, it overwrites the dummy page with the actual output, and when the dummy page auto-refreshes, it loads the real output and stops refreshing.
The bad part about this solution is that I am unable to incrementally print to the dummy page when my subroutines complete (to show progress in the script). My die statements (for when things like open should fail) are completely hidden however.
I am about to start rewriting all of my dies to print their error message to the dummy page as a work-around, but I feel like there must be a better way than the one I have implemented.
And this brings me to you, oh wise monks, seeking any and all advice you may have about this topic. Thank you in advance.
In reply to CGI Script backgrounding by agronbach
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |