In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/acab2422b2372f4b4d6e2542e9b9cf3dc0b83e92?hp=b3632c7127dbc8ae2250b65ba913d59a6e1caac6>

- Log -----------------------------------------------------------------
commit acab2422b2372f4b4d6e2542e9b9cf3dc0b83e92
Author: Karl Williamson <[email protected]>
Date:   Mon Mar 28 21:15:50 2016 -0600

    Remove deprecated literal control char variable names
    
    These were deprecated in v5.20
-----------------------------------------------------------------------

Summary of changes:
 pod/perldelta.pod |  9 ++++++++-
 pod/perldiag.pod  | 15 ---------------
 t/uni/variables.t |  4 ++--
 toke.c            | 25 ++-----------------------
 4 files changed, 12 insertions(+), 41 deletions(-)

diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index c0dbcab..027617f 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -32,7 +32,14 @@ L</Selected Bug Fixes> section.
 
 [ List each security issue as a =head2 entry ]
 
-=head1 Incompatible Changes
+=head2 Literal control character variable names are no longer permissible
+
+A variable name may no longer contain a literal control character under
+any circumstances.  These previously were allowed in single-character
+names on ASCII platforms, but have been deprecated there since Perl
+v5.20.  This affects things like C<$I<\cT>>, where I<\cT> is a literal
+control (such as a C<NAK> or C<NEGATIVE ACKNOWLEDGE> character) in the
+source code.
 
 =head2 C<NBSP> is no longer permissible in C<\N{...}>
 
diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index ea0d21e..0383ccb 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -6808,21 +6808,6 @@ only C.  This usually means there's a better way to do 
it in Perl.
 generally because there's a better way to do it, and also because the
 old way has bad side effects.
 
-=item Use of literal control characters in variable names is deprecated
-
-=item Use of literal non-graphic characters in variable names is deprecated
-
-(D deprecated) Using literal non-graphic (including control)
-characters in the source to refer to the ^FOO variables, like C<$^X> and
-C<${^GLOBAL_PHASE}> is now deprecated.  (We use C<^X> and C<^G> here for
-legibility.  They actually represent the non-printable control
-characters, code points 0x18 and 0x07, respectively; C<^A> would mean
-the control character whose code point is 0x01.) This only affects
-code like C<$\cT>, where C<\cT> is a control in the source code; C<${"\cT"}> 
and
-C<$^T> remain valid.  Things that are non-controls and also not graphic
-are NO-BREAK SPACE and SOFT HYPHEN, which were previously only allowed
-for historical reasons.
-
 =item Use of -l on filehandle%s
 
 (W io) A filehandle represents an opened file, and when you opened the file
diff --git a/t/uni/variables.t b/t/uni/variables.t
index 5601b97..edeebf4 100644
--- a/t/uni/variables.t
+++ b/t/uni/variables.t
@@ -106,7 +106,7 @@ for ( 0x0 .. 0xff ) {
         else {
             $name = sprintf "\\x%02x, a C1 control", $ord;
         }
-        $syntax_error = $::IS_EBCDIC;
+        $syntax_error = 1;
         $deprecated = ! $syntax_error;
     }
     elsif ($chr =~ /\p{XIDStart}/) {
@@ -114,7 +114,7 @@ for ( 0x0 .. 0xff ) {
     }
     elsif ($chr =~ /\p{XPosixSpace}/) {
         $name = sprintf "\\x%02x, a non-ASCII space character", $ord;
-        $syntax_error = $::IS_EBCDIC;
+        $syntax_error = 1;
         $deprecated = ! $syntax_error;
     }
     else {
diff --git a/toke.c b/toke.c
index 7daa4a7..39b2c76 100644
--- a/toke.c
+++ b/toke.c
@@ -8896,21 +8896,12 @@ S_scan_word(pTHX_ char *s, char *dest, STRLEN destlen, 
int allow_package, STRLEN
  *
  *      Because all ASCII characters have the same representation whether
  *      encoded in UTF-8 or not, we can use the foo_A macros below and '\0' and
- *      '{' without knowing if is UTF-8 or not.
- * EBCDIC already uses the rules that ASCII platforms will use after the
- * deprecation cycle; see comment below about the deprecation. */
-#ifdef EBCDIC
-#   define VALID_LEN_ONE_IDENT(s, is_utf8)                                    \
+ *      '{' without knowing if is UTF-8 or not. */
+#define VALID_LEN_ONE_IDENT(s, is_utf8)                                       \
     (isGRAPH_A(*(s)) || ((is_utf8)                                            \
                          ? isIDFIRST_utf8((U8*) (s))                          \
                          : (isGRAPH_L1(*s)                                    \
                             && LIKELY((U8) *(s) != LATIN1_TO_NATIVE(0xAD)))))
-#else
-#   define VALID_LEN_ONE_IDENT(s, is_utf8)                                    \
-    (isGRAPH_A(*(s)) || ((is_utf8)                                            \
-                         ? isIDFIRST_utf8((U8*) (s))                          \
-                         : ! isASCII_utf8((U8*) (s))))
-#endif
 
 STATIC char *
 S_scan_ident(pTHX_ char *s, char *dest, STRLEN destlen, I32 ck_uni)
@@ -8975,18 +8966,6 @@ S_scan_ident(pTHX_ char *s, char *dest, STRLEN destlen, 
I32 ck_uni)
                           : 1)
         && VALID_LEN_ONE_IDENT(s, is_utf8))
     {
-        /* Deprecate all non-graphic characters.  Include SHY as a non-graphic,
-         * because often it has no graphic representation.  (We can't get to
-         * here with SHY when 'is_utf8' is true, so no need to include a UTF-8
-         * test for it.) */
-        if ((is_utf8)
-            ? ! isGRAPH_utf8( (U8*) s)
-            : (! isGRAPH_L1( (U8) *s)
-               || UNLIKELY((U8) *(s) == LATIN1_TO_NATIVE(0xAD))))
-        {
-            deprecate("literal non-graphic characters in variable names");
-        }
-
         if (is_utf8) {
             const STRLEN skip = UTF8SKIP(s);
             STRLEN i;

--
Perl5 Master Repository

Reply via email to