Subject: | Improper handling of special methods |
AUTOLOAD() doesn't emulate can(), isa(), VERSION(), and import() properly. (Actually, I'm not sure it needs to handle VERSION() specially.)
The proper solution requires handling class and instance calls differently. Right now they do this:
$code = Hash::AsObject::can('bar'); # ERROR (dies) - should return a closure
$code = Hash::AsObject->new->can('bar'); # OK - returns 'bar'
Simplest solution: define methods can(), isa(), VERSION(), and import(). Oh, and probably DESTROY() too.