1 Nov 2010 07:14
Documentation for ${^GLOBAL_PHASE}
Florian Ragwitz <rafl <at> debian.org>
2010-11-01 06:14:51 GMT
2010-11-01 06:14:51 GMT
Hi,
I'm looking for help regarding the documentation of the new variable
${^GLOBAL_PHASE} in the perl core.
All that variable will do is expose the current global interpreter phase
to Perl space, similar to how things like Devel::GlobalDestruction
currently expose "Am I under global destruction?"
Most of the patch, which I'll attach for your convenience, is already
vetted by p5p. What I'm looking for specifically is a place to document
it. Obviously it needs an entry in perlvar, but I don't think explaining
all the details of it there is appropriate. "BEGIN, UNITCHECK, CHECK,
INIT and END" in perlmod explains many things related to
${^GLOBAL_PHASE}, but it does so from the perspective of a single
module, i.e. one compilation unit, for which most of the behaviour of
the new variable is irrelevant, as that's only concert with global
phases. Also it'd seem somewhat unlikely that anyone would look up
"perlmod - Perl modules (packages and symbol tables)" to read about the
phases of the interpreter.
Also, once a place for documenting this is found, I'd also very much
appreciate suggestions on how to actually document it.
Here's some details of the new variable.
Possible values include:
1. CONSTRUCT
(Continue reading)
Saying that a value of "START" will only be present in some BEGIN-blocks
is a little misleading. While that's true, as everything where
${^GLOBAL_PHASE} will have a value of "START" will be run from a
BEGIN-block in the main program, it's easy to get that value from code
which doesn't directly contain such a block. For example
RSS Feed