You are viewing the version of this documentation from Perl 5.39.1. This is a development version of Perl.

The %^H hash provides the same scoping semantics as $^H. This makes it useful for implementing lexically scoped pragmas. See perlpragma. All the entries are stringified when accessed at runtime, so only simple values can be accommodated. This means no references to objects, for example.

Each time a statement completes being compiled, the current value of %^H is stored with that statement, and can later be retrieved via (caller($level))[10]. See "caller EXPR" in perlfunc.

When putting items into %^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 name of its main package) and a "/" character. For example, a module Foo::Bar should use keys such as Foo::Bar/baz.

This variable was added in Perl v5.6.0.