in reply to Re: (MeowChow) Re: Writing a REAL destructor
in thread Writing a REAL destructor
Use something like:
And do not call DESTROY yourself. Perl will do that for you.package MyClass; my $count = 0; sub new { my $proto = shift; my $class = ref $proto || $proto; $count ++; my $obj = ....; bless $obj => $class; } sub DESTROY { $count --; }
Abigail
|
|---|