Fix ticket #22219
[p5sagit/p5-mst-13.2.git] / op.c
diff --git a/op.c b/op.c
index e32eab6..86cfe23 100644 (file)
--- a/op.c
+++ b/op.c
@@ -1838,14 +1838,23 @@ Perl_localize(pTHX_ OP *o, I32 lex)
            && PL_bufptr > PL_oldbufptr && PL_bufptr[-1] == ',')
        {
            char *s = PL_bufptr;
+           int sigil = 0;
 
-           while (*s && (isALNUM(*s) || UTF8_IS_CONTINUED(*s) || strchr("@$%, ", *s)))
+           /* some heuristics to detect a potential error */
+           while (*s && (strchr(", \t\n", *s)
+                       || (strchr("@$%*", *s) && ++sigil) ))
                s++;
-
-           if (*s == ';' || *s == '=')
-               Perl_warner(aTHX_ packWARN(WARN_PARENTHESIS),
-                           "Parentheses missing around \"%s\" list",
-                           lex ? (PL_in_my == KEY_our ? "our" : "my") : "local");
+           if (sigil) {
+               while (*s && (isALNUM(*s) || UTF8_IS_CONTINUED(*s)
+                           || strchr("@$%*, \t\n", *s)))
+                   s++;
+
+               if (*s == ';' || *s == '=')
+                   Perl_warner(aTHX_ packWARN(WARN_PARENTHESIS),
+                               "Parentheses missing around \"%s\" list",
+                               lex ? (PL_in_my == KEY_our ? "our" : "my")
+                               : "local");
+           }
        }
     }
     if (lex)
@@ -4933,6 +4942,11 @@ Perl_ck_ftst(pTHX_ OP *o)
            op_free(o);
            o = newop;
        }
+       else {
+         if ((PL_hints & HINT_FILETEST_ACCESS) &&
+             OP_IS_FILETEST_ACCESS(o))
+           o->op_private |= OPpFT_ACCESS;
+       }
     }
     else {
        op_free(o);