Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Debugger quit signal?

by cmeyer (Pilgrim)
on Aug 30, 2007 at 21:10 UTC ( [id://636205]=note: print w/replies, xml ) Need Help??


in reply to Debugger quit signal?

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

Replies are listed 'Best First'.
Re^2: Debugger quit signal?
by ddebrito (Sexton) on Aug 30, 2007 at 23:23 UTC
    Colin, Thanks. A big DOH! on my part. DESTROY is running when I quit the debugger (just as you also demoed) I had been using the debugger flag ( $^P ) in my code to prevent DESTROY from cleaning up some temp files so I could do further evaluation of those temp files. Ergo when I saw lots of temp files laying about I thought DESTROY was not running. Mea Culpa.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://636205]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-03-28 20:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found