From ee428a211d040dc56d9efc4a89c96886a398fc1c Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Thu, 12 Mar 2020 15:41:24 +0000 Subject: [PATCH] docs: clarify effect of $^H, %^H, ${^WARNING_BITS} See http://nntp.perl.org/group/perl.perl5.porters/257128 --- pod/perlvar.pod | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pod/perlvar.pod b/pod/perlvar.pod index 81354d96cef9..2b7a683a41e1 100644 --- a/pod/perlvar.pod +++ b/pod/perlvar.pod @@ -1892,6 +1892,10 @@ It has the same scoping as the C<$^H> and C<%^H> variables. The exact values are considered internal to the L pragma and may change between versions of Perl. +Each time a statement completes being compiled, the current value of +C<${^WARNING_BITS}> is stored with that statement, and can later be +retrieved via C<(caller($level))[9]>. + This variable was added in Perl v5.6.0. =item $OS_ERROR @@ -2184,6 +2188,10 @@ This variable contains compile-time hints for the Perl interpreter. At the end of compilation of a BLOCK the value of this variable is restored to the value when the interpreter started to compile the BLOCK. +Each time a statement completes being compiled, the current value of +C<$^H> is stored with that statement, and can later be retrieved via +C<(caller($level))[8]>. + When perl begins to parse any block construct that provides a lexical scope (e.g., eval body, required file, subroutine body, loop body, or conditional block), the existing value of C<$^H> is saved, but its value is left unchanged. @@ -2232,6 +2240,10 @@ L. All the entries are stringified when accessed at runtime, so only simple values can be accommodated. This means no pointers to objects, for example. +Each time a statement completes being compiled, the current value of +C<%^H> is stored with that statement, and can later be retrieved via +C<(caller($level))[10]>. + When putting items into C<%^H>, in order to avoid conflicting with other users of the hash there is a convention regarding which keys to use. A module should use only keys that begin with the module's name (the