in reply to Fixing nits with $object->can($method);
I solve this and several other "problems" via packages:
package Foo::Bar; use vars qw( $VERSION ); ... package Foo::Bar::_implement; use Dood::Dad; sub helper { ... } sub Foo::Bar::objectPackage { "Foo::Bar::Object"; } sub Foo::Bar::new { ... } sub Foo::Bar::Object::method { ... } ...
as expanded upon in other nodes.
Note that you can use Exporter (or similar) to avoid having to retype the module name so much (which I'm pretty sure you would dislike, but which makes for an easy way to demonstrate the technique).
- tye
|
---|