in reply to Re^2: CGI.pm ignore URL GET query string parameters
in thread CGI.pm ignore URL GET query string parameters

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

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)