my $anon_class = $self->get_anon_class; eval "package $anon_class; use base qw/$target_class Pixie::Inner/"; $anon_class->object_info(Pixie::ObjectInfo->new(object_id => $oid); bless $fetched_obj, $anon_class; Pixie::Inner::object_info = sub { my $proto = shift; my $class = ref($proto) || $proto; no strict 'refs'; ${$class . "::object_info"} = shift if @_; return ${$class . "::object_info"}; } Pixie::Inner::DESTROY { my $self = shift; my $class = ref $self; my $super_dest = $class . "::DESTROY"; $self->$super_dest(); # Why doesn't UNIVERSAL::DESTROY exist already? $self->object_info(undef); delete $::{$class . "::"} }