Subject: | use of carp() |
It would be nice if the end user could specify how the warnings should
be handled. Currently it seems like the use of carp() is fixed.
Not quite sure how to fix this, but what about adding methods to the
Data::AsObject namespace, so at least it can be changed globally?
package Data::AsObject;
sub missing_element { carp "Attempting to access non-existing hash key
$_[1]!" }
And then inside ex. Data::AsObject::Hash, you can replace
carp "Attempting to access non-existing hash key $key!"
with
$self->Data::AsObject::missing_element($key);
And do the same for the other carp() calls in Data::AsObject*.