Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: debug: local watch expression

by rmcgowan (Sexton)
on Sep 17, 2015 at 23:38 UTC ( #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
Node Status?
node history
Node Type: note [id://1142364]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2020-08-13 17:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which rocket would you take to Mars?










    Results (74 votes). Check out past polls.

    Notices?