note
btrott
DESTROY is the destructor for the class. If you use AUTOLOAD
but not DESTROY, you will get the above error message, because
AUTOLOAD is called for the DESTROY method (because AUTOLOAD
catches all undefined method calls on the object), and you
do not have a DESTROY method to call.<p>
Since you have Object Oriented Perl, I suggest you look at page
112, at the section "Destructors and autoloading". It explains
the situation far better than I can, and offers a solution (actually,
two).<p>
For those who don't have the book :), the best solution is to
define an empty DESTROY method in your class:
<code>
sub DESTROY { }
</code>
The existence of this method will prevent AUTOLOAD from being
called on object destruction.
93037
93037