Since you don't use called_as_method things like OOorNO and myargs have so many caveats on their usage as to make them useless in the general case.Did you read/run the code snippets in the EXAMPLES section of the POD? Did you read the BUGS section of the POD docs for Devel::Caller?
As I said before I think mixing OO and functional/procedural styles in this way is almost always a bad idea. I cannot think of single instance in many years of coding where something like this would be an appropriate solution.In theory, it's not such a mix as it might seem. I submit that, as polymorphism is one of the core principles of OO, this kind of inheritable (there's another one); shareable; importable/exportable; polymorphic interface is more extensible and useful than you claim; and more focused too.
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 suchThe origin of this method's name has to do with what it does. One of the errors this helps avoid is also mentioned in the docs - "can't coerce array into hash at..." Be it as it may, I thought the name fitting when I wrote it that way.
Something like is_called_as_method would be a better name for the OOorNO subroutine.I don't know why I didn't see this, but as this was one of my primary questions (naming), I'm really grateful for your idea.
You're subroutines fail in many cases. Consider: Foo::foo( Foo => 12 ); Foo->foo( Foo => 12 );Did you test this? It doesn't fail in my tests or examples (which show in fact this very thing.)
-- Tommy Butler, a.k.a. TOMMY
In reply to Re: Re^3: Seeking Wisdom: proposed fix for a broken CPAN module
by Tommy
in thread Seeking Wisdom: proposed fix for a broken CPAN module
by Tommy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |