Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
"be consistent"
 
PerlMonks  

(tye)Re: Preventing BEGIN blocks from being run in the debugger?

by tye (Cardinal)
on May 25, 2001 at 19:03 UTC ( #83329=note: print w/ replies, xml ) Need Help??


in reply to Preventing BEGIN blocks from being run in the debugger?

"perldoc perldebug" says:

Debugging compile-time statements

If you have compile-time executable statements (such as code within BEGIN and CHECK blocks or use statements), these will not be stopped by debugger, although requires and INIT blocks will, and compile-time statements can be traced with AutoTrace option set in PERLDB_OPTS). From your own Perl code, however, you can transfer control back to the debugger using the following statement, which is harmless if the debugger is not running:

$DB::single = 1;

So it seems you were close but you need to put that BEGIN block in your source code and not in PERL5DB environment variable. (Though I haven't tried this.)

        - tye (but my friends call me "Tye")


Comment on (tye)Re: Preventing BEGIN blocks from being run in the debugger?
Re: (tye)Re: Preventing BEGIN blocks from being run in the debugger?
by bikeNomad (Priest) on May 25, 2001 at 19:25 UTC
    But this is a perl tags utility; I can't edit the source code.
    In perldebguts, though, it says that the contents of PERL5DB will be inserted at the beginning of the program being debugged. Which is the same as putting it in the source code. And, in fact, had I not misspelled $DB::begin, it would have worked. However, it doesn't do what I want: if you break in a BEGIN block, the line number arrays aren't yet set up, so the tags utility won't work. Oh well...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2014-04-18 12:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (466 votes), past polls