in reply to DESTROYing an object
It will just call the destroy method and return. For example this:
will producesub Foo::DESTROY { my $self = shift; print "destroying $self\n" }; my $foo = bless {}, "Foo"; $foo->DESTROY; print "foo is $foo\n";
destroying Foo=HASH(0x4759c) foo is Foo=HASH(0x4759c) destroying Foo=HASH(0x4759c)
The first "destroying" comes from the explicit call to the method. The second by the method being called before the object is garbage collected.
|
---|