Hash::AsObject is now available from CPAN.
$h = Hash::AsObject->new(%myhash);
print $h->foo; # 123
It's all implemented in
AUTOLOAD so there are absolutely no verboten keys. All is permitted - even
DESTROY may be used as accessors/mutators.
Oops. Dang. My tests weren't checking for
isa. (*Sigh*). And I always wondered why I kept seeing people uploading two or more versions of the same distribution on the same day...