Hello all,

I'v posted this question on a (Perl)Beginners List because the answer is probably going to be perfectly clear, once I understand it; however, I've received no replies. Perhaps this goes beyond the "beginners" on the other list.

I've read a lot of doc's, etc. regarding passing parameters between html documents via the parameter-pairs listed in the query string of the url. Additionally, Guelich, Gundavaram and Birznieks' book, "CGI Programming" (2nd. ed., O'Reilly & Assoc., 2000), p. 94, explain how to "add" a new parameter to the query string via the url, e.g., the results of executing the following instruction:

   $q->parm( title => "Web Developer" );

will appear as "&title=Web+Developer" in the query string. This works, but the authors suggest that a parameter can be "modified" and/or "deleted", too. I have assumed that this means that the parameter value in the url's query string can be (should be) modified as in changed? I cannot change a value, or delete a parameter from the query string in the url. If for example, I have a parameter, "table", (i.e., a MySQL table that in this case, is to be dynamically selected later)that originates in pgm-A but is not assigned a value, then when the parameter is presented to pgm-B, the query string has a value of "&db_name=cookbook&table=&etc=etc". Notice that "&table=" is not associated with a value. If I execute an instruction such as:

   $q->param( table => "vendors" );

. . .the result (in additional to other parameters)is: "&db_name=cookbook&table=&etc=etc&table=vendors". Notice that the operation did not change the value of the existing "table" parameter, but "pushed" or ADDED another "table=vendors" pair onto the query string. Also, as the authors suggested, I have tried to execute:

$q->delete( "table" );

. . .but this will not delete or otherwise remove the "table" parameter from the query string. Also, I've been scanning through the source for CGI.pm, and apparently there is not a packaged subroutine for something like $q->modify( "table" );.

Suggestions?

Ron Wingfield

FreeBSD 4.8 -- Apache http 2.0.28 -- MySQL client/server 4.1.7 Perl 5.8.5 -- p5-DBD-mysql-2.9004 driver -- p5-DBI-1.46

In reply to Modifying Parameter Values w/CGI.pm by rtwingfield

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.