This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
toke.c: Correct comment
[perl5.git] / toke.c
diff --git a/toke.c b/toke.c
index ddd4319..44a65aa 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -3735,7 +3735,7 @@ S_intuit_more(pTHX_ register char *s)
  *
  * First argument is the stuff after the first token, e.g. "bar".
  *
- * Not a method if bar is a filehandle.
+ * Not a method if foo is a filehandle.
  * Not a method if foo is a subroutine prototyped to take a filehandle.
  * Not a method if it's really "Foo $bar"
  * Method if it's "foo $bar"
@@ -6912,7 +6912,7 @@ Perl_yylex(pTHX)
                        op_free(rv2cv_op);
                        SvREFCNT_dec(((SVOP*)pl_yylval.opval)->op_sv);
                        ((SVOP*)pl_yylval.opval)->op_sv = SvREFCNT_inc_simple(sv);
-                       pl_yylval.opval->op_private = 0;
+                       pl_yylval.opval->op_private = OPpCONST_FOLDED;
                        pl_yylval.opval->op_flags |= OPf_SPECIAL;
                        TOKEN(WORD);
                    }
@@ -7341,8 +7341,13 @@ Perl_yylex(pTHX)
            s = SKIPSPACE1(s);
            if (*s == '{')
                PRETERMBLOCK(DO);
-           if (*s != '\'')
-               s = force_word(s,WORD,TRUE,TRUE,FALSE);
+           if (*s != '\'') {
+               d = scan_word(s, PL_tokenbuf, sizeof PL_tokenbuf, 1, &len);
+               if (len) {
+                   d = SKIPSPACE1(d);
+                   if (*d == '(') s = force_word(s,WORD,TRUE,TRUE,FALSE);
+               }
+           }
            if (orig_keyword == KEY_do) {
                orig_keyword = 0;
                pl_yylval.ival = 1;