sara2005 has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
Is there any other approach or example other than the one provided by merlyn for running long process thru CGI?
The above approach described in the column by merlyn works perfectly but the reason I posted this question is
1. I am confused as to how to use a portion of the code as a subroutine. i.e. I have a need to run long processes in all my cgi programs and I would like to call this as a subroutine by passing the commands I want to execute. for example, if I run validate_login.cgi, I want to call the subroutine (say run_commands()), execute and complete the long process, return back to validate_login.cgi and then redirect to the next page display_menu.cgi. The same process will be followed for other pages as well. Hence, I am looking to see if there are any examples on those lines.
2. I am also thinking of having watching long process by meryln as a separate cgi (say 'run_long_process.cgi') rather than subroutine so that each of the cgi programs I write could be redirected to the 'run_long_process.cgi' to execute the commands. But then I was not sure how to to redirect to the appropriate cgi based on what page I came from? (i.e. if I came from 'page1.cgi', after running the commands in 'run_long_process.cgi', it should be redirected to 'page2.cgi'. If I started from 'page3.cgi', it should be redirected to 'page4.cgi'. Do I have to hardcode this part in run_long_process.cgi?)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Running Long process thru CGI
by sgifford (Prior) on Jun 14, 2006 at 03:50 UTC | |
|
Re: Running Long process thru CGI
by rodion (Chaplain) on Jun 14, 2006 at 04:17 UTC | |
|
Re: Running Long process thru CGI
by merlyn (Sage) on Jun 14, 2006 at 03:39 UTC | |
|
Re: Running Long process thru CGI
by gam3 (Curate) on Jun 14, 2006 at 02:52 UTC |