Perhaps you should post some example code that shows your problem. I coded up a simple test that shows DESTROY() being called, as I'd expect.
# debug_test_DESTROY.pl
package Foo;
my $i;
sub new {
return bless [++$i]
}
sub DESTROY {
warn "destroying object <$_[0][0]>\n";
}
package Main;
$x = Foo->new;
$y = Foo->new;
print "hello";
> perl -d debug_test_DESTROY.pl
Loading DB routines from perl5db.pl version 1.28
Editor support available.
Enter h or `h h' for help, or `man perldebug' for more help.
Foo::(debug_test_DESTROY.pl:3): my $i;
DB<1> n
Main::(debug_test_DESTROY.pl:15): $x = Foo->new;
DB<1> n
Main::(debug_test_DESTROY.pl:16): $y = Foo->new;
DB<1> n
Main::(debug_test_DESTROY.pl:18): print "hello";
DB<1> q
destroying object <1> ## <--- look, DESTROY() called for $x ##
at debug_test_DESTROY.pl line 10
Foo::DESTROY('Foo=ARRAY(0x97acc6c)') called at debug_test_DEST
+ROY.pl line 0
eval {...} called at debug_test_DESTROY.pl line 0
destroying object <2> ## DESTROY() called for $y ##
at debug_test_DESTROY.pl line 10
Foo::DESTROY('Foo=ARRAY(0x97f1348)') called at debug_test_DEST
+ROY.pl line 0
eval {...} called at debug_test_DESTROY.pl line 0
-Colin.
WHITEPAGES.COM | INC