sub Foo::DESTROY { my $self = shift; print "destroying $self\n" }; my $foo = bless {}, "Foo"; $foo->DESTROY; print "foo is $foo\n";