You can use Class::MOP to figure this out pretty easily.
my @methods = Class::MOP::Class->initialize('My::Package')->get_all_me
+thods;
What is in @methods is an array of
Class::MOP::Method objects which you can call the following methods on:
- name - the local method name
- package_name - the package where the method is defined
- fully_qualified_name - the package name + name
- body - returns the code ref
It should be noted that unlike
Class::Inspector and the newer
Class::Sniff, this
will honor the MRO (Method Resolution Order) you have chosen to use, so in 5.10 (or under
Class::C3) it will return a correct method list if you use the c3 MRO instead of the standard dfs (depth-first-search) MRO.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.