On Fri Feb 20 08:01:25 2009, EDAVIS wrote:
Show quoted text> % perl -MCGI -Mstrict -e 'CGI::param';
> % perl -MCGI -Mstrict -e 'CGI::url_param';
> Bareword "CGI::url_param" not allowed while "strict subs" in use at -e
> line 1.
> Execution of -e aborted due to compilation errors.
>
> Why the inconsistency? It is a bit confusing that CGI::param can be
> used like this but CGI::url_param cannot.
The inconsistency is because as a performance issue, param() is loaded
by default, but url_param() is not. When you call it without parens,
there is no way to know that you mean to refer to a method, so that it
could be possibly be loaded on demand. If you tell CGI to import
everything up front, then you get consistent behavior and no warning:
perl -MCGI=:all -Mstrict -e 'CGI::url_param';
But I don't recommend that, I recommend using the OO interface.
For now I'm marking this bug report as "rejected", because CGI.pm is
working as intended here.
Mark