use strict; use Devel::FindBlessedRefs qw(find_refs); my $x = bless {}, "test1"; my $y = bless {}, "test1"; my $z = $x; undef $_ for find_refs "yeah";