FloydATC has asked for the wisdom of the Perl Monks concerning the following question:
Given a package name, is it possible to somehow get a list of all the subs that exist within that package?
I know I can check for a given sub like this
$sub = $obj->can("print");
but what I'd like is something like
@subnames = $obj->can(); # Just to illustrate, does not work
or even
@subnames = Some::Class::can(); # Just to illustrate, does not work
--
Time flies when you don't know what you're doing
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Package introspection
by jau (Hermit) on Jul 17, 2010 at 11:17 UTC | |
by FloydATC (Deacon) on Jul 17, 2010 at 11:29 UTC | |
Re: Package introspection
by JavaFan (Canon) on Jul 17, 2010 at 09:51 UTC | |
Re: Package introspection
by chromatic (Archbishop) on Jul 17, 2010 at 22:14 UTC | |
Re: Package introspection
by morgon (Priest) on Jul 18, 2010 at 07:10 UTC | |
by FloydATC (Deacon) on Jul 19, 2010 at 05:00 UTC | |
Re: Package introspection
by exussum0 (Vicar) on Jul 18, 2010 at 11:34 UTC |
Back to
Seekers of Perl Wisdom