diff options
author | Nicholas Clark <nick@ccl4.org> | 2013-03-20 16:47:16 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2013-03-21 09:13:52 +0100 |
commit | 982110e06e40aad7a538cb788327cca8aaabce22 (patch) | |
tree | e066a5b50eb3efeb3074649db1ffd561fc376bb1 /gv.c | |
parent | 53213d38f22e9356f489162e494d2ffa46ec2ca2 (diff) | |
download | perl-982110e06e40aad7a538cb788327cca8aaabce22.tar.gz |
Add a deprecation warning for all uses of @*, %*, &* and **.
All compile-time uses of the ** typeglob now warn.
Diffstat (limited to 'gv.c')
-rw-r--r-- | gv.c | 29 |
1 files changed, 22 insertions, 7 deletions
@@ -1638,16 +1638,23 @@ 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) { - if (*name == '*') { + } 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) Perl_ck_warner_d(aTHX_ packWARN2(WARN_DEPRECATED, WARN_SYNTAX), "$* is no longer supported, and will become a syntax error"); - } else if (*name == '#') { - Perl_ck_warner_d(aTHX_ packWARN2(WARN_DEPRECATED, - WARN_SYNTAX), - "$# is no longer supported"); - } + 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 ? '%' + : '*'); } if (sv_type==SVt_PV || sv_type==SVt_PVGV) { switch (*name) { @@ -1940,6 +1947,14 @@ 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) |