develooper Front page | perl.perl5.porters | Postings from February 2022

Re: Pre-RFC: check if we're running under the debugger

Thread Previous | Thread Next
Ricardo Signes
February 23, 2022 13:37
Re: Pre-RFC: check if we're running under the debugger
Message ID:
On Wed, Feb 23, 2022, at 8:13 AM, Ovid via perl5-porters wrote:
> On Wednesday, 23 February 2022, 14:03:47 CET, Leon Timmermans <> wrote:
> > You can check if $^P is not 0?
> I never knew about that particular variable. If it's stable and guaranteed (I would assume yes to both), it would be nice to add that to the perldebug POD (at least on v5.26 I don't see it in there).
> If that's considered the best canonical approach, I'm happy to submit a PR.

I think that's the best way.

This tells you that "something is doing something with debug facilities," which may not mean that is being used to debug.  For that, maybe you'd look at $DB::header, but this is a losing battle.  $^P tells you that the -d switch was passed, more or less.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About