in reply to Package introspection

You can also check the symbol table (you won't get any inherited methods then, which may or may not be what you want).

For a package "Hubba", the symbol table can be found in %Hubba:: (the keys of this hash are the symbols) and the subroutines are in the CODE-slot.

So you find all subs defined in a package $package you can simply grep for all symbols that have a defined CODE-slot like this ugly hack:

my @sub_names = grep { defined *{"${package}::$_"}{CODE} } keys %{"${p +ackage}::"}

Replies are listed 'Best First'.
Re^2: Package introspection
by FloydATC (Deacon) on Jul 19, 2010 at 05:00 UTC
    I'll use Class::Inspector for now as it looks a lot cleaner, but this is good to know and I bet this is exactly how that class works too.

    -- Time flies when you don't know what you're doing