use CGI; my $cgi = CGI->new; print $cgi->foo(), "\n"; sub CGI::foo { my $self = shift; return $self->p('foo'); }