Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Can a Perl module "inspect" itself and provide details about methods and parameters?

by swl (Parson)
on Sep 22, 2019 at 22:02 UTC ( [id://11106552]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Devel::Symdump;
    my $obj = Devel::Symdump->rnew( $package_name ); 
    my @methods = $obj->functions();
    #  if you are sure private methods only start with underscore...
    my @public_methods = grep {$_ !~ /^_/} @methods;
    
  2. or download this
    use Class::Inspector;
    my $methods = Class::Inspector->methods( $package_name );
    my $public_methods = Class::Inspector->methods( $package_name, 'public
    +' );
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11106552]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-04-16 20:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found