use strict; use CGI; sub meth {'p'} my $cgi = CGI->new; print $cgi->${\meth()}('foo')."\n";