<HTML> This is the third message regarding the "checkers project" It regards the use of exec() and/or system() in .cgi scripts

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>


In reply to exec in .cgi (followup to semi-finite background process) by Konda

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.