From 5b6da579918d96df1d2cd514c5f756d1d246c723 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Mon, 8 Apr 2013 16:53:47 +0200 Subject: [PATCH] Revert "Add a deprecation warning for all uses of @*, %*, &* and **." This reverts commit 982110e06e40aad7a538cb788327cca8aaabce22. Conflicts: pod/perldelta.pod --- dist/B-Deparse/t/deparse.t | 7 +------ gv.c | 29 +++++++---------------------- pod/perldiag.pod | 7 ------- t/lib/warnings/gv | 18 ------------------ 4 files changed, 8 insertions(+), 53 deletions(-) diff --git a/dist/B-Deparse/t/deparse.t b/dist/B-Deparse/t/deparse.t index dd50f1f..7d4f9fe 100644 --- a/dist/B-Deparse/t/deparse.t +++ b/dist/B-Deparse/t/deparse.t @@ -1055,16 +1055,11 @@ print $_; #### # $#- $#+ $#{%} etc. my @x; -@x = ($#{`}, $#{~}, $#{!}, $#{@}, $#{$}, $#{%}, $#{^}, $#{&}); +@x = ($#{`}, $#{~}, $#{!}, $#{@}, $#{$}, $#{%}, $#{^}, $#{&}, $#{*}); @x = ($#{(}, $#{)}, $#{[}, $#{{}, $#{]}, $#{}}, $#{'}, $#{"}, $#{,}); @x = ($#{<}, $#{.}, $#{>}, $#{/}, $#{?}, $#{=}, $#+, $#{\}, $#{|}, $#-); @x = ($#{;}, $#{:}); #### -# $#{*} -# It's a known TODO that warnings are deparsed as bits, not textually. -no warnings; -() = $#{*}; -#### # ${#} interpolated # It's a known TODO that warnings are deparsed as bits, not textually. no warnings; diff --git a/gv.c b/gv.c index 52291d4..1e20f99 100644 --- a/gv.c +++ b/gv.c @@ -1646,23 +1646,16 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags, require_tie_mod(gv, "!", newSVpvs("Errno"), "TIEHASH", 1); else if (*name == '-' || *name == '+') require_tie_mod(gv, name, newSVpvs("Tie::Hash::NamedCapture"), "TIEHASH", 0); - } else if (sv_type == SVt_PV && *name == '#') { - Perl_ck_warner_d(aTHX_ packWARN2(WARN_DEPRECATED, - WARN_SYNTAX), - "$# is no longer supported"); - } - if (*name == '*') { - if (sv_type == SVt_PV) + } else if (sv_type == SVt_PV) { + if (*name == '*') { Perl_ck_warner_d(aTHX_ packWARN2(WARN_DEPRECATED, WARN_SYNTAX), "$* is no longer supported, and will become a syntax error"); - else - Perl_ck_warner_d(aTHX_ packWARN2(WARN_DEPRECATED, WARN_SYNTAX), - "%c* is deprecated, and will become a syntax error", - sv_type == SVt_PVAV ? '@' - : sv_type == SVt_PVCV ? '&' - : sv_type == SVt_PVHV ? '%' - : '*'); + } else if (*name == '#') { + Perl_ck_warner_d(aTHX_ packWARN2(WARN_DEPRECATED, + WARN_SYNTAX), + "$# is no longer supported"); + } } if (sv_type==SVt_PV || sv_type==SVt_PVGV) { switch (*name) { @@ -1955,14 +1948,6 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags, if (sv_type == SVt_PV) Perl_ck_warner_d(aTHX_ packWARN2(WARN_DEPRECATED, WARN_SYNTAX), "$* is no longer supported, and will become a syntax error"); - else { - Perl_ck_warner_d(aTHX_ packWARN2(WARN_DEPRECATED, WARN_SYNTAX), - "%c* is deprecated, and will become a syntax error", - sv_type == SVt_PVAV ? '@' - : sv_type == SVt_PVCV ? '&' - : sv_type == SVt_PVHV ? '%' - : '*'); - } break; case '#': /* $# */ if (sv_type == SVt_PV) diff --git a/pod/perldiag.pod b/pod/perldiag.pod index a19c959..55b5153 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -2646,13 +2646,6 @@ modifiers. You can enable C for a lexical scope (even a whole file) with C. (In older versions: when C<$*> was set to a true value then all regular expressions behaved as if they were written using C.) -=item %c* is deprecated, and will become a syntax error - -(D deprecated, syntax) The punctuation variables C<@*>, C<&*>, C<**> and -C<%*> will be removed soon. In future such code will fail to compile with a -syntax error. Removing these variables along with C<$*> will permit future -syntax additions. - =item $# is no longer supported (D deprecated, syntax) The special variable C<$#>, deprecated in older diff --git a/t/lib/warnings/gv b/t/lib/warnings/gv index 332810c..1618e40 100644 --- a/t/lib/warnings/gv +++ b/t/lib/warnings/gv @@ -100,7 +100,6 @@ $* is no longer supported, and will become a syntax error at - line 7. $a = $#; $a = $*; EXPECT -@* is deprecated, and will become a syntax error at - line 3. $# is no longer supported at - line 4. $* is no longer supported, and will become a syntax error at - line 5. ######## @@ -112,23 +111,6 @@ $a = $*; EXPECT $# is no longer supported at - line 2. $* is no longer supported, and will become a syntax error at - line 3. -@* is deprecated, and will become a syntax error at - line 5. -######## -# gv.c -$a = \@*; -$a = \&*; -$a = \**; -$a = \%*; -no warnings 'deprecated' ; -$a = \@*; -$a = \&*; -$a = \**; -$a = \%*; -EXPECT -@* is deprecated, and will become a syntax error at - line 2. -&* is deprecated, and will become a syntax error at - line 3. -** is deprecated, and will become a syntax error at - line 4. -%* is deprecated, and will become a syntax error at - line 5. ######## # gv.c use warnings 'syntax' ; -- 1.8.3.1