summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2016-05-21 12:22:33 -0700
committerFather Chrysostomos <sprout@cpan.org>2016-07-13 01:12:47 -0700
commita15a3d9b600adf7d9dd78193d608361f302b0370 (patch)
tree0e874f12d3de784f0107028fc484255738fa98d4 /mg.c
parent1a53cdb5c0a2c7f6b92ecb87480a4448bb6022c0 (diff)
downloadperl-a15a3d9b600adf7d9dd78193d608361f302b0370.tar.gz
Disable ${^ENCODING}
${^ENCODING} is disabled and tests are modified to account.
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c36
1 files changed, 2 insertions, 34 deletions
diff --git a/mg.c b/mg.c
index 4321a401ad..a89916d471 100644
--- a/mg.c
+++ b/mg.c
@@ -856,8 +856,6 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
case '\005': /* ^E */
if (nextchar != '\0') {
if (strEQ(remaining, "NCODING"))
- sv_setsv(sv, _get_encoding());
- else if (strEQ(remaining, "_NCODING"))
sv_setsv(sv, NULL);
break;
}
@@ -2733,41 +2731,11 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
#endif
}
else {
- unsigned int offset = 1;
- bool lex = FALSE;
-
- /* It may be the shadow variable ${E_NCODING} which has lexical
- * scope. See comments at Perl__get_encoding in this file */
- if (*(mg->mg_ptr + 1) == '_') {
- if (CopSTASH(PL_curcop) != get_hv("encoding::",0))
- Perl_croak_no_modify();
- lex = TRUE;
- offset++;
- }
- if (strEQ(mg->mg_ptr + offset, "NCODING")) {
- if (lex) { /* Use the shadow global */
- SvREFCNT_dec(PL_lex_encoding);
- if (SvOK(sv) || SvGMAGICAL(sv)) {
- PL_lex_encoding = newSVsv(sv);
- }
- else {
- PL_lex_encoding = NULL;
- }
- }
- else { /* Use the regular global */
- SvREFCNT_dec(PL_encoding);
- if (SvOK(sv) || SvGMAGICAL(sv)) {
+ if (strEQ(mg->mg_ptr + 1, "NCODING") && SvOK(sv))
if (PL_localizing != 2) {
Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED),
- "Setting ${^ENCODING} is deprecated");
+ "${^ENCODING} is no longer supported");
}
- PL_encoding = newSVsv(sv);
- }
- else {
- PL_encoding = NULL;
- }
- }
- }
}
break;
case '\006': /* ^F */