In perl.git, the branch abigail/deprecation has been updated <http://perl5.git.perl.org/perl.git/commitdiff/b9e2a3484152f4fceee8731e0556cb4159713bb1?hp=ec19e9626e764ba25c4b1d28c11d7e24b1d36184>
- Log ----------------------------------------------------------------- commit b9e2a3484152f4fceee8731e0556cb4159713bb1 Author: Abigail <[email protected]> Date: Wed Nov 16 19:07:32 2016 +0100 Setting ${^ENCODE} will be fatal by 5.28. Hence, we adapted the warning, to mention the version in which it will become a fatal error. ----------------------------------------------------------------------- Summary of changes: handy.h | 3 +++ mg.c | 4 ++-- pod/perldeprecation.pod | 10 ++++++++++ pod/perldiag.pod | 4 +++- t/lib/warnings/gv | 2 +- t/lib/warnings/mg | 4 ++-- 6 files changed, 21 insertions(+), 6 deletions(-) diff --git a/handy.h b/handy.h index 3f7fcb0..8a0ad0a 100644 --- a/handy.h +++ b/handy.h @@ -2206,6 +2206,9 @@ void Perl_mem_log_del_sv(const SV *sv, const char *filename, const int linenumbe # define deprecate_disappears_in(when,message) \ Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED), \ message ", and will disappear in Perl " when) +# define deprecate_fatal_in(when,message) \ + Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED), \ + message ". Its use will be fatal in Perl " when) #endif /* Internal macros to deal with gids and uids */ diff --git a/mg.c b/mg.c index d0d3b9d..719242d 100644 --- a/mg.c +++ b/mg.c @@ -2707,8 +2707,8 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg) else { if (strEQ(mg->mg_ptr + 1, "NCODING") && SvOK(sv)) if (PL_localizing != 2) { - Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED), - "${^ENCODING} is no longer supported"); + deprecate_fatal_in("5.28", + "${^ENCODING} is no longer supported"); } } break; diff --git a/pod/perldeprecation.pod b/pod/perldeprecation.pod index 422dc1b..8effa9f 100644 --- a/pod/perldeprecation.pod +++ b/pod/perldeprecation.pod @@ -44,6 +44,16 @@ then result in a syntax error. Since the attributes do not do anything, removing them from your code fixes the deprecation warning; and removing them will not influence the behaviour of your code. + +=head3 ${^ENCODING} is no longer supported. + +The special variable C<${^ENCODING}> was used to implement +the C<encoding> pragma. Setting this variable to anything other +than C<undef> was deprecated in Perl 5.22. Full deprecation +of the variable happened in Perl 5.25.3. + +Setting this variable will become a fatal error in Perl 5.28. + =head2 Perl 5.24 =head3 Use of C<< *glob{FILEHANDLE} >> diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 8341233..bbe9287 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -2109,11 +2109,13 @@ unlikely to be what you want. described in L<perlunicode> and L<perlre>. You used C<\p> or C<\P> in a regular expression without specifying the property name. -=item ${^ENCODING} is no longer supported +=item ${^ENCODING} is no longer supported. Its use will be fatal in Perl 5.28 (D deprecated) The special variable C<${^ENCODING}>, formerly used to implement the C<encoding> pragma, is no longer supported as of Perl 5.26.0. +Setting this variable will become a fatal error in Perl 5.28. + =item entering effective %s failed (F) While under the C<use filetest> pragma, switching the real and diff --git a/t/lib/warnings/gv b/t/lib/warnings/gv index ddc4c97..1c407df 100644 --- a/t/lib/warnings/gv +++ b/t/lib/warnings/gv @@ -64,7 +64,7 @@ $a = ${^E_NCODING}; ${^ENCODING} = 1; ${^E_NCODING} = 1; # We pretend this variable never existed. EXPECT -${^ENCODING} is no longer supported at - line 4. +${^ENCODING} is no longer supported. Its use will be fatal in Perl 5.28 at - line 4. ######## # gv.c use warnings 'syntax' ; diff --git a/t/lib/warnings/mg b/t/lib/warnings/mg index 5fe2a88..a4231bf 100644 --- a/t/lib/warnings/mg +++ b/t/lib/warnings/mg @@ -110,5 +110,5 @@ ${^ENCODING} = 42; ${^ENCODING} = undef; { local ${^ENCODING} = 37; } EXPECT -${^ENCODING} is no longer supported at - line 1. -${^ENCODING} is no longer supported at - line 4. +${^ENCODING} is no longer supported. Its use will be fatal in Perl 5.28 at - line 1. +${^ENCODING} is no longer supported. Its use will be fatal in Perl 5.28 at - line 4. -- Perl5 Master Repository
