In perl.git, the branch abigail/deprecation has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/ae0371a8468921a97f56e32636efa6baaabb2093?hp=8bb44853ce6b142ec4e7e40c651f6414918ba87b>

- Log -----------------------------------------------------------------
commit ae0371a8468921a97f56e32636efa6baaabb2093
Author: Abigail <[email protected]>
Date:   Tue Nov 15 23:51:53 2016 +0100

    Remove deprecation warnings related to $* and $#.
    
    The magic variables $* and $# were deprecated in 5.000. Their magical
    meaning was removed in Perl 5.10. Since then, a warning was issued
    if the variables were used.
    
    This warnings has been removed.
-----------------------------------------------------------------------

Summary of changes:
 gv.c                    | 14 ------------
 pod/perldeprecation.pod | 33 +++++++++++++++++++++++++++
 pod/perldiag.pod        | 18 ---------------
 t/lib/warnings/2use     | 20 +++++++++--------
 t/lib/warnings/gv       | 60 -------------------------------------------------
 5 files changed, 44 insertions(+), 101 deletions(-)

diff --git a/gv.c b/gv.c
index d8cb79d..bcec318 100644
--- a/gv.c
+++ b/gv.c
@@ -2150,13 +2150,6 @@ S_gv_magicalize(pTHX_ GV *gv, HV *stash, const char 
*name, STRLEN len,
                 SvREADONLY_on(av);
             }
             break;
-       case '*':               /* $* */
-       case '#':               /* $# */
-           if (sv_type == SVt_PV)
-               /* diag_listed_as: $* is no longer supported */
-               Perl_ck_warner_d(aTHX_ packWARN2(WARN_DEPRECATED, WARN_SYNTAX),
-                                "$%c is no longer supported", *name);
-           break;
        case '\010':    /* $^H */
            {
                HV *const hv = GvHVn(gv);
@@ -2263,13 +2256,6 @@ S_maybe_multimagic_gv(pTHX_ GV *gv, const char *name, 
const svtype sv_type)
             require_tie_mod_s(gv, '!', "Errno", 1);
         else if (*name == '-' || *name == '+')
             require_tie_mod_s(gv, *name, "Tie::Hash::NamedCapture", 0);
-    } else if (sv_type == SVt_PV) {
-        if (*name == '*' || *name == '#') {
-            /* diag_listed_as: $* is no longer supported */
-            Perl_ck_warner_d(aTHX_ packWARN2(WARN_DEPRECATED,
-                                             WARN_SYNTAX),
-                             "$%c is no longer supported", *name);
-        }
     }
     if (sv_type==SVt_PV || sv_type==SVt_PVGV) {
       switch (*name) {
diff --git a/pod/perldeprecation.pod b/pod/perldeprecation.pod
index 95f89d2..a70fe7b 100644
--- a/pod/perldeprecation.pod
+++ b/pod/perldeprecation.pod
@@ -81,6 +81,39 @@ To tie the handle, use C<tie *$scalar> (with an explicit 
asterisk).  The same
 applies to C<tied *$scalar> and C<untie *$scalar>.
 
 
+=head2 Perl 5.10
+
+=head3 $* is no longer supported
+
+C<$*> was once a magic variable. C<$*> enabled or disabled
+multi-line matching within a string. Deprecated since Perl 5.000,
+its special meaning was removed in Perl 5.10. Aftwards, an
+deprecation message was issued when using this variable; this message
+was discontinued in Perl 5.26.
+
+Instead of using C<$*> you should use the C</m> (and maybe C</s>) regexp
+modifiers.  You can enable C</m> for a lexical scope (even a whole file)
+with C<use re '/m'>.  (In older versions: when C<$*> was set to a true value
+then all regular expressions behaved as if they were written using C</m>.)
+
+Although you can use C<$*> as a normal variable, you are discouraged 
+from doing so.
+
+=head3 $# is no longer supported
+
+C<$#> was once a magic variable. C<$#> could be used to format
+printed numbers. Deprecated since Perl 5.000,
+its special meaning was removed in Perl 5.10. Aftwards, an
+deprecation message was issued when using this variable; this message
+was discontinued in Perl 5.26.
+
+Instead of using C<$#>, you should be using C<(s)printf> to format
+your numbers.
+
+Although you can use C<$*> as a normal variable, you are discouraged 
+from doing so.
+
+
 =head1 SEE ALSO
 
 L<warnings>, L<diagnostics>.
diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index 686134b..8341233 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -3108,24 +3108,6 @@ You specified a character that has the given plainer way 
of writing it,
 and which is also portable to platforms running with different character
 sets.
 
-=item $* is no longer supported
-
-(D deprecated, syntax) The special variable C<$*>, deprecated in older
-perls, has been removed as of 5.10.0 and is no longer supported.  In
-previous versions of perl the use of C<$*> enabled or disabled multi-line
-matching within a string.
-
-Instead of using C<$*> you should use the C</m> (and maybe C</s>) regexp
-modifiers.  You can enable C</m> for a lexical scope (even a whole file)
-with C<use re '/m'>.  (In older versions: when C<$*> was set to a true value
-then all regular expressions behaved as if they were written using C</m>.)
-
-=item $# is no longer supported
-
-(D deprecated, syntax) The special variable C<$#>, deprecated in older
-perls, has been removed as of 5.10.0 and is no longer supported.  You
-should use the printf/sprintf functions instead.
-
 =item '%s' is not a code reference
 
 (W overload) The second (fourth, sixth, ...) argument of
diff --git a/t/lib/warnings/2use b/t/lib/warnings/2use
index 4e10d4b..ab5586a 100644
--- a/t/lib/warnings/2use
+++ b/t/lib/warnings/2use
@@ -361,19 +361,21 @@ Use of uninitialized value $c in scalar chop at - line 9.
 ########
 
 # Check that deprecation warnings are not implicitly disabled by use
-$*;
+our $foo :unique;
 use warnings "void";
-$#;
+our $bar :unique;
+$*;
 EXPECT
-$* is no longer supported at - line 3.
-$# is no longer supported at - line 5.
-Useless use of a variable in void context at - line 5.
+Attribute "unique" is deprecated, and will disappear in Perl 5.28 at - line 3.
+Attribute "unique" is deprecated, and will disappear in Perl 5.28 at - line 5.
+Useless use of a variable in void context at - line 6.
 ########
 
 # Check that deprecation warnings are not implicitly disabled by no
-$*;
+our $foo :unique;
 no warnings "void";
-$#;
+our $bar :unique;
+$*;
 EXPECT
-$* is no longer supported at - line 3.
-$# is no longer supported at - line 5.
+Attribute "unique" is deprecated, and will disappear in Perl 5.28 at - line 3.
+Attribute "unique" is deprecated, and will disappear in Perl 5.28 at - line 5.
diff --git a/t/lib/warnings/gv b/t/lib/warnings/gv
index 8a93f8b..ddc4c97 100644
--- a/t/lib/warnings/gv
+++ b/t/lib/warnings/gv
@@ -59,66 +59,6 @@ EXPECT
 Use of inherited AUTOLOAD for non-method main::fᕃƌ() is deprecated at - 
line 7.
 ########
 # gv.c
-$a = ${"#"};
-$a = ${"*"};
-no warnings 'deprecated' ;
-$a = ${"#"};
-$a = ${"*"};
-EXPECT
-$# is no longer supported at - line 2.
-$* is no longer supported at - line 3.
-########
-# gv.c
-$a = ${#};
-$a = ${*};
-no warnings 'deprecated' ;
-$a = ${#};
-$a = ${*};
-EXPECT
-$# is no longer supported at - line 2.
-$* is no longer supported at - line 3.
-########
-# gv.c
-$a = $#;
-$a = $*;
-$# = $a;
-$* = $a;
-$a = \$#;
-$a = \$*;
-no warnings 'deprecated' ;
-$a = $#;
-$a = $*;
-$# = $a;
-$* = $a;
-$a = \$#;
-$a = \$*;
-EXPECT
-$# is no longer supported at - line 2.
-$* is no longer supported at - line 3.
-$# is no longer supported at - line 4.
-$* is no longer supported at - line 5.
-$# is no longer supported at - line 6.
-$* is no longer supported at - line 7.
-########
-# gv.c
-@a = @#;
-@a = @*;
-$a = $#;
-$a = $*;
-EXPECT
-$# is no longer supported at - line 4.
-$* is no longer supported at - line 5.
-########
-# gv.c
-$a = $#;
-$a = $*;
-@a = @#;
-@a = @*;
-EXPECT
-$# is no longer supported at - line 2.
-$* is no longer supported at - line 3.
-########
-# gv.c
 $a = ${^ENCODING};
 $a = ${^E_NCODING};
 ${^ENCODING} = 1;

--
Perl5 Master Repository

Reply via email to