As a debugging tip, you might try this, to see what parameters you actually have, and what their values are:

At the top of your script, add one more use: use Data::Dumper;. Then, right after your print end_form; statement, add this line:

print "<pre> "; print Dumper Vars(); print " </pre>"

Now run the script and see what you get. It will dump all parameters as key/value pairs to the screen. You can also run it from the commandline. In fact, using CGI is really convenient; it lets you run scripts from the command line where you simply add the parameter list to the command line. For example, your script is named "games.pl"... so run it like this and see what output you get:

perl games.pl "gamename = test"

...that's assuming an MSDOS type OS. Change the quotes to work with whatever flavor of operating system you're on. The point is you'll see pretty clearly what the error messages (if any) are, and what else is going on. And above all, make sure you've got warnings enabled. That can often tell you what's wrong too.


Dave


In reply to Re: Determining which CGI submit() button was pressed by davido
in thread Determining which CGI submit() button was pressed by Nik

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.