Konda has asked for the wisdom of the Perl Monks concerning the following question:
I followed some advice of the responses to the thread "semi-finite background process" and it didn't seem to work...
I am activatng a .cgi script that will update a move list. With the help of perlmonkey, I was able to run everything smoothly but...
the example of the problem is at:
http://www.rit.edu/~ee697b/cgi-bin/ENTER_HERE.html
follow the instructions and get a new window for the link. (link is : http://www.rit.edu/~ee697b/cgi-bin/board.html)
After activation, there is an exec statement in a section, that calls upon a perl script.
Ideally, I'd like for this script to be run everytime the "done" button is pressed - but it doesn't - I try to specify different types of paths, and different ways to call system() and exec() (with and without fork() ), and the darn thing either doesn't do anything, or has an error. It is supposed to update the board in(see below) board.html (by writing over it using board.cgi - which is called inside of brdwrite.cgi) with the last move pair in the table in the main .cgi, but it does not. It should show a piece (X or O) moved to a different square.
I am really not sure if I can get all my scripts into one piece of code, and I would really like this process to run separately from the main html page (well fram.cgi)
I implemented the process listed by btrott, in response to my thread "semi-finite background process" - using a pid check with a fork, and closing STDIN,OUT,ERR, and then using exec. This doesn't seem to work. I have an example at http://www.rit.edu/~ee697b/cgi-bin/update.cgi (code @ www.rit.edu/~ee697b/cgi-bin/update.txt) All it does is continously say "forked off a child", and never executes the exec() process.
Can I name this script as an environment variable somehow? Or can is be run with the full path ? Can I name the script .cgi or .pl with no problems? Can I call *two* .cgi scripts with one FORM ACTION ?
the code for this is at:
http://www.rit.edu/~ee697b/cgi-bin/fram.txt
(fram.cgi) http://www.rit.edu/~ee697b/cgi-bin/brdwrite.txt
(brdwrite.cgi) http://www.rit.edu/~ee697b/cgi-bin/board.txt
(board.cgi) the code operates at:
http://www.rit.edu/~ee697b/cgi-bin/fram.cgi
Thank you for your time! as always...
Neil G. </HTML>
|
|---|