----- Original Message ----- From: Ron Wingfield To: mailto:beginners-cgi@perl.org Sent: Tuesday, January 04, 2005 2:25 PM Subject: Modifying Parameter Values
Hello all, First-timer here. Please be gentle. I'm posting this question on the Beginners List because the answer is probably going to be perfectly clear, once I understand it. 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", that originates in pgm-A but is not assigned no 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 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 --------------------------------------------------------------------------------