Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re^2: Interactive scripting with DB

by tlm (Prior)
on May 26, 2005 at 03:42 UTC ( #460497=note: print w/replies, xml ) Need Help??

in reply to Re: Interactive scripting with DB
in thread Interactive scripting with debugger

Putting the line kill 2, $$ will cause the debugger to break at that point in the source (on Unix, anyway).

I had never seen that trick before. Cool. I have been using this one instead:

$DB::single = 1;
That causes the debugger to enter "single-step" mode, which amounts to programmatically setting a breakpoint in the next executable line. This is particularly useful for causing the debugger to stop at places that happen before the first executable line, e.g.:
BEGIN { $DB::single = 1; } use Foo;
The code above will enable stepping through the loading of 'Foo', which otherwise would happen before the place at which DB normally starts (i.e. the first executable line). I see that kill 2, $$ works well for this too. One more trick for the bag.

the lowliest monk

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2023-03-31 04:13 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (74 votes). Check out past polls.