diff options
author | Florian Ragwitz <rafl@debian.org> | 2010-09-28 03:49:48 +0200 |
---|---|---|
committer | Florian Ragwitz <rafl@debian.org> | 2010-11-14 17:18:05 +0100 |
commit | 9ebf26ad4d30e289feeaec20ee238d6874f4b27e (patch) | |
tree | 5e692b55a003378e60185b463aadad3a2ecd85f1 /mg.c | |
parent | 24802a741468d87fdd5e986702d44cf3253b596f (diff) | |
download | perl-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.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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 */ |