diff options
author | Yitzchak Scott-Thoennes <sthoenna@efn.org> | 2004-03-22 02:32:05 -0800 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2004-03-22 19:25:59 +0000 |
commit | decca21cb05bd8819a555574b7c51f4597013939 (patch) | |
tree | 5244a4d8e1c323fe4f769c8c5a2a6a9f3da2df9d /toke.c | |
parent | 3b8c0df9bfb9b3699a23e8633f5ede3b929d4620 (diff) | |
download | perl-decca21cb05bd8819a555574b7c51f4597013939.tar.gz |
Re: [PATCH] warn on !=~
Message-ID: <20040322183106.GA1284@efn.org>
More warnings for this case.
p4raw-id: //depot/perl@22553
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -3383,14 +3383,18 @@ Perl_yylex(pTHX) s++; tmp = *s++; if (tmp == '=') { - /* was this !=~ where !~ was meant? */ + /* was this !=~ where !~ was meant? + * warn on m:!=~\s+([/?]|[msy]\W|tr\W): */ + if (*s == '~' && ckWARN(WARN_SYNTAX)) { char *t = s+1; while (t < PL_bufend && isSPACE(*t)) ++t; - if (*t == '/' || (*t == 'm' && !isALNUM(t[1])) || *t == '?') + if (*t == '/' || *t == '?' || + ((*t == 'm' || *t == 's' || *t == 'y') && !isALNUM(t[1])) || + (*t == 't' && t[1] == 'r' && !isALNUM(t[2]))) Perl_warner(aTHX_ packWARN(WARN_SYNTAX), "!=~ should be !~"); } |