in reply to Importing CGI methods into a subclass as a class method

I think there is some confusion with the CGI.pm syntax. use CGI qw(param) will import the param sub to the caller's namespace, however new CGI qw(param) will initialize a new CGI object with a query string of "param". See:
use CGI; my $q = new CGI qw(param); print "\$q->param($_) = " . $q->param($_) . "\n" for $q->param; print param('asdf'); # not imported, error __END__ prints: $ perl test.pl $q->param(keywords) = param Undefined subroutine &main::param called at - line 4.
If the methods really were being imported into the namespace, they would be automatically usable as methods on your objects, as they are not bound by the lexical scope of your function call. However, I doubt it would work right, as the method calls would eventually translate to CGI::param($obj, 'foo') instead what you probably want: CGI::param($obj->{query}, 'foo'), (i.e., $obj->{query}->param('foo')).

I don't see the problem with using AUTOLOAD to dispatch to the CGI object, even if you want to use it with more than just the param method:

sub AUTOLOAD { my $func = $AUTOLOAD; $func =~ s/^.*:://; $self->{query}->$func(@_); }

blokhead