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
In reply to Re: Writing a REAL destructor
by Abigail-II
in thread Writing a REAL destructor
by NaSe77
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |