in reply to Re: Re: Seeking Wisdom: proposed fix for a broken CPAN module
in thread Seeking Wisdom: proposed fix for a broken CPAN module
It's better than it was, but it has two big problems as far as I am concerned:
A few other commments after a quick skim.
Your synopsis just shows how to load the module, rather than how to use it. It doesn't mention the subroutines at all. You should be able to look at the synopsis and get a basic idea of how the module is used.
Something like is_called_as_method would be a better name for the OOorNO subroutine.
Why the bizzare, and undocumented, coercion of undef keys/values in coerce_array (which is badly named since it takes a list of values, and returns a hashref)? undef and the empty string are different values and should be treated as such.
The bulk of this module comprises a lightweight, pure-Perl emulation of the Devel::Caller library's "called_as_method()" routine which is written in C.
Why? There seems to be no point in re-inventing a wheel that works very well and replacing it with one that... well... doesn't :-).
You're subroutines fail in many cases. Consider:
Foo::foo( Foo => 12 ); Foo->foo( Foo => 12 );
This is really nasty since you can get inconsistant behaviour depending on what modules are loaded at the time. Basically, if you're first key is the same as a module name you're in trouble.
called_as_method is complex because it needs to be to work.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re^3: Seeking Wisdom: proposed fix for a broken CPAN module
by Tommy (Chaplain) on Jan 15, 2003 at 05:23 UTC | |
by adrianh (Chancellor) on Jan 15, 2003 at 17:36 UTC |