This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make the warning "interpreted as function" a bit less annoying,
[perl5.git] / toke.c
diff --git a/toke.c b/toke.c
index 935a32a..96b33cb 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -10444,7 +10444,11 @@ S_checkcomma(pTHX_ const char *s, const char *name, const char *what)
            }
            while (isSPACE(*w))
                ++w;
-           if (!*w || !strchr(";|})]oaiuw!=", *w))     /* an advisory hack only... */
+           /* the list of chars below is for end of statements or
+            * block / parens, boolean operators (&&, ||, //) and branch
+            * constructs (or, and, if, until, unless, while, err, for).
+            * Not a very solid hack... */
+           if (!*w || !strchr(";&/|})]oaiuwef!=", *w))
                Perl_warner(aTHX_ packWARN(WARN_SYNTAX),
                            "%s (...) interpreted as function",name);
        }