Welcome to the Monastery | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Yes and no.
No ...Perl is so dynamic that you will hardly automatically parse all subs without an AI which is more clever than you. But Yes ... you might built a solution which fits in 80-90 percent of the cases. For instance is it allowed to dynamically proxy subs with AUTOLOAD and the way args are read from @_ can vary in many ways. In the case of OO classes you'd also need to check the inheritance tree in @ISA. And I don't even know which backdoors XS modules are allowed to use. Saying so,after using a modul it's possible to dynamically introspect its Symbol Table Hash aka STASH. And it's possible to list all lines involving the @_ array. Something standard like my ($self,$name) = @_ might be easy to decipher. But this will only show you the internal variable name and not the description of an argument $name. Hence this would only be a semi automatic help often requiring human intervention. But in your case, no way From my experience with Image Magick this won't help much though, because the underlying C library is pretty inconsistent and Perl might only provide a thin layer.
Cheers Rolf
In reply to Re: Can a Perl module "inspect" itself and provide details about methods and parameters?
by LanX
|
|