in reply to Package introspection
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 |