On Wed, Feb 23, 2022 at 1:55 PM Ovid via perl5-porters < perl5-porters@perl.org> wrote: > Hi all, > > For those of us who use the debugger heavily, it's useful to know if we're > running under the debugger. Unfortunately, the debugger doesn't natively > export a way to do that. I've hacked on the debugger numerous times and I > see that people do things like checking $DB::{single} or $INC{'perl5db.pl > '}. > > It would be nice to be able to do something like: > > if ( $ENV{PERL_DEBUGGER_RUNNING} ) { > ... > } > > (A better name or approach is welcome) > > This is a small itch to scratch, but it also seems very easy to scratch. > > Thoughts? Or have I missed some documented, dead-trivial way of getting > this information? > You can check if $^P is not 0? LeonThread Previous | Thread Next