in reply to How to explicitly destroy an object so that all other references to it would become false?

It's definitely possible, but it's not the most efficient thing in the whole wide world. The simple solution is to keep track of all your copies of the object so you can either implicitly drop them off a scope, or explicitly undef them. But it's definitely possible:
use strict; use Devel::FindBlessedRefs qw(find_refs); my $x = bless {}, "test1"; my $y = bless {}, "test1"; my $z = $x; undef $_ for find_refs "yeah";

-Paul

  • Comment on Re: How to explicitly destroy an object so that all other references to it would become false?
  • Download Code