Syntactic Confectionery Delight | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
This is a nice module, and should be combined with Symbol::Sub::Approx to actively help (while issuing a warning). :-) There's a major problem with it though; the usual AUTOLOAD problem. Maybe another class in the inheritance tree has an AUTOLOAD to handle it. Then Help isn't really helping--rather the opposite. So you need to do By adding just two more statements in AUTOLOAD you illustrate a new Perl 5.10 feature. :-) But when moving onto Perl 5.10 your algorithm, while elegant and simple, becomes fragile due to the new method resolution orders (mro). Utilizing the lovely Devel::Symdump module by Andreas J. König you can replace with If you're on a pre 5.10 perl you can use Class::ISA's self_and_super_path. (I've contacted Mr Burke, the maintainer of Class::ISA, about updating it to use mro::get_linear_isa when it's available. Currently you need to figure out that yourself.) Of course, this makes it much less educational about the symbol table. :-) Update: I remembered that Help makes itself part of the inheritance tree, so I've removed the import of &subname to avoid it being inherited, and removed Help from %known_method. lodin In reply to Re: Help.pm automatically explains how to use misused objects
by lodin
|
|