in reply to InsideOut - even tighter coupling
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: InsideOut - even tighter coupling
by MidLifeXis (Monsignor) on Oct 10, 2003 at 18:04 UTC |