########
# toke.c
use warnings 'syntax' ;
-print ("")
+print ("");
+print ("") and $x = 1;
+print ("") or die;
+print ("") // die;
+print (1+2) * 3 if 0; # only this one should warn
+print (1+2) if 0;
EXPECT
-print (...) interpreted as function at - line 3.
+print (...) interpreted as function at - line 7.
########
# toke.c
no warnings 'syntax' ;
########
# toke.c
use warnings 'syntax' ;
-printf ("")
+printf ("");
+printf ("") . '';
EXPECT
-printf (...) interpreted as function at - line 3.
+printf (...) interpreted as function at - line 4.
########
# toke.c
no warnings 'syntax' ;
########
# toke.c
use warnings 'syntax' ;
-sort ("")
+sort ("");
+sort ("") . '';
EXPECT
-sort (...) interpreted as function at - line 3.
+sort (...) interpreted as function at - line 4.
########
# toke.c
no warnings 'syntax' ;
}
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);
}