szabgab has asked for the wisdom of the Perl Monks concerning the following question:
Given a Perl script or a module or a class, how can one find the list of all the functions? Given an object - assuming I know which class it belongs to - how can one find out which methods are available to it?
I know the simple case is finding all the sub blabla {} entries and the general case cannot be solved and that I should use PPI for this anyway.
Can we define rules that assuming them we can find all the functions? Can we find better proximations?
For example:
- If I have string eval in my code I know there can be anything injected.
- If I use Class::Accessor then I can look for mk_accessors that will reveal the extra methods I have.
I know even if we collect all the method generator modules that are currently available on CPAN and support it, someone will upload a new one. But then we can just add support for that too.
So what virtual function generators are there?
What other kind of code (besides string eval) can generate methods on the fly? Can we recognize them in a reasonable way?