boom has asked for the wisdom of the Perl Monks concerning the following question:

What is the best way to discover all of the subroutines a Perl module has?

Replies are listed 'Best First'.
Re: Listing a module's subroutines
by nagalenoj (Friar) on Mar 06, 2009 at 10:45 UTC
    Dear monk,

    You can also use the Devel::symdump module to list the functions in a module.

    Sample code:

    use strict; use warnings; package AA; sub one { print("Inside AA::one\n"); } sub two { print("Inside AA::two\n"); } package main; use lib "/home/blah/Devel-Symdump-2.08/share/perl/5.8.8/"; use Devel::Symdump; our @pack = qw(AA); our $oj = Devel::Symdump->new(@pack); print $oj->functions;

    Incase, if you need to know the subroutines in many modules, you can add the module names in @pack array.

    our @pack = qw(AA Devel);
Re: Listing a module's subroutines
by velusamy (Monk) on Mar 06, 2009 at 09:17 UTC
    Hi,

    You can get all subroutine names from %Your_Module:: variable. The keys of this hash are subroutine names of the module.

    Note: Your_Module is your module name.

Re: Listing a module's subroutines
by Anonymous Monk on Mar 06, 2009 at 09:17 UTC
    The best way is to RTFM. The Manual will explain how the module works, what subs are available, if any are generated, if you should UTSL...