fionbarr has asked for the wisdom of the Perl Monks concerning the following question:

I have an module (not mine) that crashes when the program is run in debug and runs OK without debug. Is there a flag that will programmatically turn on/off the debugger? Thanks.

Replies are listed 'Best First'.
Re: debugger switch
by ww (Archbishop) on Jul 22, 2011 at 16:17 UTC
    fionbarr, I can't make sense of your question. That may be my problem, but you haven't given me much to go on.

    How are you causing the program to "run in debug" by invoking perl -d program.pl -- or by some other means? And how do you make the program run "without debug?".

    Suggestion in any case (if you haven't already): read perldoc perldebtut and perldoc debug?

      I run my program 'perl -d <program>' but would like to say 'turn off the debugger' before I invoke the module that doesn't like the debugger.

        Try this:

            perl <program>

        The -d switch is invoking the debugger. No switch, no debugger.

        UPDATE: Read perlvar and pay particular attention to the built-in variables $DEBUGGING ($^D) and $PERLDB ($^P). (Sorry, I initially misread your question.)