in reply to Profiling Code (Subroutine Documenting.)

All non annonymous subs have an entry in the symbol table. Thus for a list of subs, walk the symbol table and return all the elements that have a code ref. As for getting the code, No idea. One of the B modules might do what you want.
  • Comment on Re: Profiling Code (Subroutine Documenting.)

Replies are listed 'Best First'.
Re: Re: Profiling Code (Subroutine Documenting.)
by adrianh (Chancellor) on Mar 03, 2004 at 16:28 UTC
    One of the B modules might do what you want

    Devel::Symdump does this quite handily. For example to print all the subroutines in the symbol table for package Foo do:

    use Devel::Symdump; print "$_\n" foreach Devel::Symdump->functions('Foo');

    Of course - this does ignore any subroutines that arrive via AUTOLOAD.