in reply to Object Suicide
then to commit suicide you'd do:foreach (@GLOBAL_OBJECT_LIST) { $_->{backref} = \$_; }
The nasty part of that is that none of your objects will ever get destroyed automatically because of the circular references. You could make the backrefs weak to fix that, but assuming the list really is global, then it would be much simpler to commit suicide with:undef ${ $_->{backref} };
@GLOBAL_OBJECT_LIST = grep { $_ != $self } @GLOBAL_OBJECT_LIST;
|
|---|