summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorFlorian Ragwitz <rafl@debian.org>2010-09-28 03:49:48 +0200
committerFlorian Ragwitz <rafl@debian.org>2010-11-14 17:18:05 +0100
commit9ebf26ad4d30e289feeaec20ee238d6874f4b27e (patch)
tree5e692b55a003378e60185b463aadad3a2ecd85f1 /mg.c
parent24802a741468d87fdd5e986702d44cf3253b596f (diff)
downloadperl-9ebf26ad4d30e289feeaec20ee238d6874f4b27e.tar.gz
Add ${^GLOBAL_PHASE}
This exposes the current top-level interpreter phase to perl space.
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/mg.c b/mg.c
index 334eb80c95..01240a7449 100644
--- a/mg.c
+++ b/mg.c
@@ -877,6 +877,12 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
case '\006': /* ^F */
sv_setiv(sv, (IV)PL_maxsysfd);
break;
+ case '\007': /* ^GLOBAL_PHASE */
+ if (strEQ(remaining, "LOBAL_PHASE")) {
+ sv_setpvn(sv, PL_phase_names[PL_phase],
+ strlen(PL_phase_names[PL_phase]));
+ }
+ break;
case '\010': /* ^H */
sv_setiv(sv, (IV)PL_hints);
break;
@@ -892,7 +898,7 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
Perl_emulate_cop_io(aTHX_ &PL_compiling, sv);
}
break;
- case '\020':
+ case '\020':
if (nextchar == '\0') { /* ^P */
sv_setiv(sv, (IV)PL_perldb);
} else if (strEQ(remaining, "REMATCH")) { /* $^PREMATCH */