1Devel::GlobalPhase(3) User Contributed Perl DocumentationDevel::GlobalPhase(3)
2
3
4

NAME

6       Devel::GlobalPhase - Detect perl's global phase on older perls.
7

SYNOPSIS

9           use Devel::GlobalPhase;
10           print global_phase; # RUN
11
12           use Devel::GlobalPhase -var;
13           print ${^GLOBAL_PHASE}; # RUN
14

DESCRIPTION

16       This gives access to ${^GLOBAL_PHASE} in versions of perl that don't
17       provide it. The built in variable will be used if it is available.
18
19       If all that is needed is detecting global destruction,
20       Devel::GlobalDestruction should be used instead of this module.
21

EXPORTS

23   global_phase
24       Returns the global phase either from "${^GLOBAL_PHASE}" or by
25       calculating it.
26

OPTIONS

28   -var
29       If this option is specified on import, the global variable
30       "${^GLOBAL_PHASE}" will be created if it doesn't exist, emulating the
31       built in variable from newer perls.
32

BUGS

34       •   There are tricks that can be played with B or XS that would fool
35           this module for the INIT and END phase.
36
37       •   During an "END {}" block created at runtime after this module is
38           loaded, the phase may be reported as "RUN".  While this could be
39           made more accurate, it would slow down the module significantly
40           during the RUN phase, and has the potential to segfault perl.
41

AUTHOR

43       haarg - Graham Knop (cpan:HAARG) <haarg@haarg.org>
44
45   CONTRIBUTORS
46       Uses some code taken from Devel::GlobalDestruction.
47
49       Copyright (c) 2013 the Devel::GlobalPhase "AUTHOR" and "CONTRIBUTORS"
50       as listed above.
51

LICENSE

53       This library is free software and may be distributed under the same
54       terms as perl itself.
55
56
57
58perl v5.38.0                      2023-07-20             Devel::GlobalPhase(3)
Impressum