diff options
author | Nicholas Clark <nick@ccl4.org> | 2013-03-20 09:23:49 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2013-03-21 09:13:52 +0100 |
commit | 53213d38f22e9356f489162e494d2ffa46ec2ca2 (patch) | |
tree | 8be53685a888cb36aea22b3ebb22c6b686f4bbf0 /gv.c | |
parent | ff68367153668fa69490c3a2ec009c228a10795f (diff) | |
download | perl-53213d38f22e9356f489162e494d2ffa46ec2ca2.tar.gz |
Change the warning for $* to add ", and will become a syntax error".
The intent is that $*, @*, %*, &* and ** stop being parsed as punctuation
variables, freeing up the syntax for other use (possibly "splats").
Diffstat (limited to 'gv.c')
-rw-r--r-- | gv.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -1639,11 +1639,14 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags, else if (*name == '-' || *name == '+') require_tie_mod(gv, name, newSVpvs("Tie::Hash::NamedCapture"), "TIEHASH", 0); } else if (sv_type == SVt_PV) { - if (*name == '*' || *name == '#') { - /* diag_listed_as: $* is no longer supported */ + if (*name == '*') { Perl_ck_warner_d(aTHX_ packWARN2(WARN_DEPRECATED, WARN_SYNTAX), - "$%c is no longer supported", *name); + "$* 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"); } } if (sv_type==SVt_PV || sv_type==SVt_PVGV) { @@ -1934,11 +1937,14 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags, break; } case '*': /* $* */ + 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"); + break; 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); + "$# is no longer supported"); break; case '\010': /* $^H */ { |