Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re^5: Unwanted parameter when executing CGI scripts

by Anonymous Monk
on Jan 06, 2013 at 01:25 UTC ( #1011819=note: print w/ replies, xml ) Need Help??

in reply to Re^4: Unwanted parameter when executing CGI scripts
in thread [SOLVED] Unwanted parameter when executing CGI scripts


Interestingly, the delete method seems to remove the respective entry only from $q->params, but not from $q->url_params (now guess which of the two I (have to) use).

You know what :) you don't really *have* to :) there are many options, patch, monkeypatch CGI, fix code ....

Besides this, I didn't get your code to work like I want. Perhaps I have another error, but at the moment it seems that $q->keywords is empty if the script is called without any parameters, so $q -> keywords evaluates to false in this case, and the code doesn't get executed anyways.

Yeah, if there are no keywords, don't delete keywords -- makes sense to me :)

Comment on Re^5: Unwanted parameter when executing CGI scripts
Replies are listed 'Best First'.
Re^6: Unwanted parameter when executing CGI scripts
by Nocturnus (Sexton) on Jan 07, 2013 at 08:26 UTC

    Well, it might make sense, but it's not what I want. As I wrote above, the problem arose when I was trying to pass parameters from the query string to another script by constructing a link which contains these parameters. I used the following method (pseudocode):

    In, fill hash with all parameters from query string, using $q->url_param (and not $q->param) Do something with the hash entries Construct a new query string from the hash entries Generate a link to<new query string>

    Now, I if call


    (without any parameters), the resulting link is


    i.e. there is an empty parameter "keywords" in the link which should not be there.

    This was not acceptable for me. Solving that problem turned out not to be too easy because I wanted to keep the "keywords" parameter if it had been in the query string in the first place.

    See my post below for additional misbehavior of and for how I solved the problem.



Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1011819]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2015-11-25 09:01 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (672 votes), past polls