Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: debug: local watch expression

by rmcgowan (Sexton)
on Sep 17, 2015 at 23:38 UTC ( [id://1142364]=note: print w/replies, xml ) Need Help??


in reply to debug: local watch expression

I found this post searching for help for the same sort of problem. The solutions suggested did not help, but did point me something that did. I've known about the $DB::single variable for some time, and came up with this solution:

if (! $var) { $DB::single = 1; }

Put this in the source file, just before the point of failure, and run the script usign perl -d script.

Execution will stop when $var becomes zero or undef, but only at the point where you put the code. If it changes anywhere else, outside the scope of the test, nothing is done.

The sixty four thousand dollar question is if this has any side effects that might cause other problems. That would be nice to know.

Thanks.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2024-03-29 09:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found