The DVK answer is accurate, but a bit long. The short answer is yes, you can, but you will not know what was intended as a public object method and what was not. Private methods and functions imported from other modules may be displayed.
The easiest way to get a list of callable, specific (i.e. non-AUTOLOAD) methods is to use the meta object perl5i methods () .
use perl5i::2; my $object = Something::Something->new; my @methods = $object->mo->methods;
This at least eliminates a lot of code.
Schwern
source share