Friday, March 8, 2013

How could you list all the methods defined in the package (say CGI) in Perl?

use CGI;

no strict 'refs';
print join ', ', grep { defined &{ "CGI::$_" } } keys %{ CGI:: };

No comments :