in reply to How do I make a destructor?
You can create a descructor like this:
But before, you should define a object counter and methods for management it:sub DESTROY{ my $self = shift; $self->coun_decr(); bless $self, $ISA[0]; }
my $inst_count = 0; sub get_inst_count { $inst_count } sub _incr_inst_count { ++$inst_count } sub _decr_inst_count { --$inst_count }
In Section
Seekers of Perl Wisdom