http://qs321.pair.com?node_id=722795

szabgab has asked for the wisdom of the Perl Monks concerning the following question:

While we are still not exactly there with Padre but I would like to get your opinion on the issue.

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:

So what else should I check?

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?

Update

After seeing the response of ikegami I see I have to make it clear I meant that I'd like to do it without running the code although, it might also be a good strategy to try to run code and get the information that way. The only problem can be with the source code of a missile launcher that might start the count-down in a BEGIN block.