Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Interactive scripting with DB

by tlm (Prior)
on May 26, 2005 at 03:42 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-18 15:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found