Just add an additional scope, sub and var for the DESTROY method to use as a register of things it needs to work with.
{ my %register; sub DESTROY { my $self=shift; delete $_->{$self} foreach values %register; } sub __register_inside_out { my $ref=shift; $register{$ref}=$ref; } } { __register_inside_out(\(my %property)); sub property { my $self=shift; if (@_) { $property{$self}=shift; return $self; } return $property{$self}; } }
HTH
First they ignore you, then they laugh at you, then they fight you, then you win.
-- Gandhi
In reply to Re: InsideOut - even tighter coupling
by demerphq
in thread InsideOut - even tighter coupling
by MidLifeXis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |