Subject: | droppings in namespace |
The namespaces got droppings in them, which allows you to do this:
use Data::AsObject;
my $obj = dao({});
$obj->carp; # Data::AsObject::Hash=HASH(0x8c6b818) at ...
To fix this, you can use namespace::clean:
package Data::AsObject::Hash;
use namespace::clean -except => 'AUTOLOAD';
...
And the same in Data::AsObject*
Working example:
use Data::AsObject;
use namespace::clean (
-except => 'AUTOLOAD',
-cleanee => 'Data::AsObject::Hash',
);
my $obj = dao({});
$obj->carp; # Attempting to access non-existing hash key carp! ...