#!/usr/bin/perl -w use strict; our $other; my $main = foo->new(); print "undef object: ";; undef $main; print "exit: ";; package foo; use Object::Destroyer; sub new { my $package = shift; my $self = {}; bless $self => $package; $::other = $self; my $ret = Object::Destroyer->new($self); return $ret; } sub DESTROY { my $self =shift; print "DESTROYing $self\n"; #undef $self # doesn't help } #### undef object: DESTROYing foo=HASH(0x817f9d0) exit: DESTROYing foo=HASH(0x817f9d0)