This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
change #25129 was overzealous in delaying the call to ckWARN
[perl5.git] / toke.c
diff --git a/toke.c b/toke.c
index ae56a6f..19bac4f 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -3515,7 +3515,7 @@ Perl_yylex(pTHX)
            OPERATOR(',');
        if (tmp == '~')
            PMop(OP_MATCH);
-       if (tmp && isSPACE(*s) && strchr("+-*/%.^&|<",tmp) && ckWARN(WARN_SYNTAX))
+       if (tmp && isSPACE(*s) && ckWARN(WARN_SYNTAX) && strchr("+-*/%.^&|<",tmp))
            Perl_warner(aTHX_ packWARN(WARN_SYNTAX), "Reversed %c= operator",(int)tmp);
        s--;
        if (PL_expect == XSTATE && isALPHA(tmp) &&
@@ -3685,8 +3685,8 @@ Perl_yylex(pTHX)
            else if (*s == '{') {
                char *t;
                PL_tokenbuf[0] = '%';
-               if (strEQ(PL_tokenbuf+1, "SIG") && (t = strchr(s, '}'))
-                   && (t = strchr(t, '=')) && ckWARN(WARN_SYNTAX))
+               if (strEQ(PL_tokenbuf+1, "SIG")  && ckWARN(WARN_SYNTAX)
+                   && (t = strchr(s, '}')) && (t = strchr(t, '=')))
                {
                    char tmpbuf[sizeof PL_tokenbuf];
                    for (t++; isSPACE(*t); t++) ;