Re: I feel like destroying something!



Randal L. Schwartz wrote:
You need a destructor when your object holds things that need more care to
delete than simply letting the data structure go away. For example: the
object changes need to be saved to disk, or some temporary files are related
to the object.

Or you created a cyclic reference and need to break it. (If you don't know what this is, chances are good you never created one, so don't worry about it.)


If that's not the case, you don't need a DESTROY.

And you never *call* the DESTROY. Perl calls it when the last reference
has been lost.

Perhaps your program design suffers by having too many globals, and not enough
scope reduction. Do you have any package variables, or a large number of "my"
variables that live outside all subroutines?


--
Just my 0.00000002 million dollars worth,
Shawn

"For the things we have to learn before we can do them, we learn by doing them."
Aristotle
.