in reply to [SOLVED] Unwanted parameter when executing CGI scripts
use CGI; my $cgi = CGI->new; for ($ENV{QUERY_STRING}) { delete $cgi->{param}{keywords} if length && !/[&=]/; } ... rest of the code goes here ...
Of course, the better answer is: stop using CGI.pm; use Plack.
PS: yes, it does have to do with <isindex>. This is a very old HTML tag that was the predecessor to modern HTML forms. It submitted just a single field which was intended as a "search" field. Because only a single field was ever submitted, there was no need for the "&fieldname=" bits of the query string. Thus CGI.pm assumes that when there is no ampersand nor equals sign in the query string, an isindex-style query has been made.
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Unwanted parameter when executing CGI scripts
by Nocturnus (Beadle) on Jan 04, 2013 at 18:48 UTC | |
Re^2: Unwanted parameter when executing CGI scripts
by Nocturnus (Beadle) on Jan 05, 2013 at 08:29 UTC | |
by tobyink (Canon) on Jan 05, 2013 at 14:00 UTC | |
by Nocturnus (Beadle) on Jan 05, 2013 at 16:30 UTC | |
by tobyink (Canon) on Jan 05, 2013 at 23:08 UTC | |
by Nocturnus (Beadle) on Jan 07, 2013 at 08:07 UTC | |
Re^2: Unwanted parameter when executing CGI scripts
by Anonymous Monk on Jan 04, 2013 at 18:38 UTC |
In Section
Seekers of Perl Wisdom