in reply to Modifying Parameter Values w/CGI.pm

Your table= parameter is undefined, so CGI.pm pretends it doesn't exist. Interestingly enough, the addition of the new value to the end of the query string will be interpreted correctly.

So, when you pass the '&db_name=cookbook&table=&etc=etc&table=vendors' back to another CGI script, the script will percieve a parameter named 'table' with one value 'vendors'.

As an aside, I recommend CGI::Simple, which has the same interface as CGI, but works faster and better.

Anima Legato
.oO all things connect through the motion of the mind

  • Comment on Re: Modifying Parameter Values w/CGI.pm

Replies are listed 'Best First'.
Re^2: Modifying Parameter Values w/CGI.pm
by rtwingfield (Acolyte) on Jan 05, 2005 at 02:02 UTC
    Thanks, Legato, I hadn't thought of that. As I've mentioned, I'm new to serious Perl, CGI, etc., and I still tend to think in terms of traditional transaction-oriented, CPU/dumb-terminal architecture.) Perhaps I could try an experiment to have the parent pgm-A assign some default value, e.g., "foobar", and then see if the value will (hopefully) be changed. That will be simple enough.

    Some may ask "why not just omit the unused parameter from being included by pgm-A?" Well, obviously, why not, other than I want to use a "copy-book" include for a parameter list. In OS/400 for example, whether COBOL or RPG, I usually just include a pointer to a data structure as a single parameter, rather than a list of individual scalers (MUCH more efficient). This datastructure can be the description of an entire record format (and in the case of OS/400, an externally described data-structure); therefore, the entire record format with value content can be passed as a single parameter. If some fields in the data-structure are zero, blank, or null, . . .it doesn't matter.

    Also, thanks for the "heads-up" on CGI::simple. Ron W.