summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOvid <ovid@cpan.org>2022-02-23 15:48:06 +0100
committerKarl Williamson <khw@cpan.org>2022-02-23 11:08:59 -0700
commit2b031f68cbd94fd2378a0554999316c603b81ea5 (patch)
treece7c3f30e1bc764ba77235cc2cbe4a1f1702db01
parentb552559790c519346bfaf2f75b5c27f658bab010 (diff)
downloadperl-2b031f68cbd94fd2378a0554999316c603b81ea5.tar.gz
Update perldebug.pod to explain detection of running under the debugger
-rw-r--r--pod/perldebug.pod10
1 files changed, 10 insertions, 0 deletions
diff --git a/pod/perldebug.pod b/pod/perldebug.pod
index 2c58ca3e24..20fa8d7be2 100644
--- a/pod/perldebug.pod
+++ b/pod/perldebug.pod
@@ -84,6 +84,16 @@ Debug a given program using threads (experimental).
=back
+If Perl is called with the C<-d> switch, the variable C<$^P> will hold a true
+value. This is useful if you need to know if your code is running under the
+debugger:
+
+ if ( $^P ) {
+ # running under the debugger
+ }
+
+See L<perlvar/$^P> for more information on the variable.
+
=head2 Debugger Commands
The interactive debugger understands the following commands: