use Tie::Hash::Inheriting (); package Hash::Inheriting; sub new { my ($class) = @_; my $self = bless({}, $class); tie(%$self, "Tie::$class"); return $self; } sub DESTROY { my ($self) = @_; untie(%$self); }