in reply to finding stuff in the docs

No, there is no default "destroy" method available for Perl objects.

However, if the last reference to a blessed object is removed, Perl does look for a method named DESTROY (note uppercase letters, they're required!). And if it can find a DESTROY method, it will execute that. But the author of the module (or one of the modules from which it inherits) will have to have written that method specifically!

Hope this helps.

Liz

Replies are listed 'Best First'.
Re: finding stuff in the docs
by Abigail-II (Bishop) on Oct 20, 2003 at 14:49 UTC
    The question wasn't about Perl objects, but about Tk widgets. All Tk widgets have an destroy method (lower case). It, unlike DESTROY, does what the name suggests: it destroys the widget, and is an appropriate way of getting rid of widgets.

    Abigail

      My only assumption is that 'destroy' is usable against any object from any module, and therefore is not specific to Tk - is this the case?

      I was referring to the above, incorrect assumption, in case that wasn't clear.

      Liz