Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Answer: How do I make a destructor?

by nite_man (Deacon)
on Feb 10, 2003 at 08:48 UTC ( #234053=categorized answer: print w/replies, xml ) Need Help??

Q&A > object-oriented programming > How do I make a destructor? - Answer contributed by nite_man

You can create a descructor like this:
sub DESTROY{ my $self = shift; $self->coun_decr(); bless $self, $ISA[0]; }
But before, you should define a object counter and methods for management it:
my $inst_count = 0; sub get_inst_count { $inst_count } sub _incr_inst_count { ++$inst_count } sub _decr_inst_count { --$inst_count }

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
[choroba]: I don't see it when XP doesn't change either
[marinersk]: That has always been its behavior, but I'm a visual/spacial- awareness guy. When the node disappears, it messes with my head, even though it is on the right margin.
[marinersk]: I was hoping there was a way to turn it on and make it stay on.

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2017-05-29 13:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?