if there is a way to keep GET parameters from populating $cgi->param().
Why? Check the result of request_method() first, then decide on how you want to handle parameters.
Or, if you really insist on that strange behaviour, inherit from CGI and override param() and multi_param(). Something like this:
package StrangeCGI; # completely untested! use strict; use warnings; use parent 'CGI'; sub multi_param { my ($sself,@args)=@_; if ($self->request_method() ne 'POST') { return; } else { return $self->SUPER::multi_param(@args); } } sub param { my ($sself,@args)=@_; if ($self->request_method() ne 'POST') { return; } else { return $self->SUPER::param(@args); } } 1;
I thought I remembered there being a pragma or something that allowed that,
I don't think that was ever possible.
but I'm probably misremembering.
You probably are.
Alexander
In reply to Re^3: CGI.pm ignore URL GET query string parameters
by afoken
in thread CGI.pm ignore URL GET query string parameters
by Danny
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |