diff options
author | David Mitchell <davem@iabyn.com> | 2013-10-22 16:48:16 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2013-10-22 17:01:30 +0100 |
commit | 46879fadd034dcb5d6f720076845767f8ccf152d (patch) | |
tree | 0c165f352ef17b1fac2e665cc83118421961886b /toke.c | |
parent | fcbc518d7ac7875b7f443e72caf15fd07ab023a6 (diff) | |
download | perl-46879fadd034dcb5d6f720076845767f8ccf152d.tar.gz |
spurious "Use of "-x" without parentheses" mesg
RT #120288.
Something like '-X' at the start of a line (where X is one char, but not a
filetest operator) was giving a spurious
Warning: Use of "-a" without parentheses is ambiguous
error. This was because the toker was provisionally marking the -a as the
last encountered unary operator (PL_last_uni), then not unmarking it when
it found that that it wasn't in fact a filetest operator.
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -5708,7 +5708,6 @@ Perl_yylex(pTHX) DEBUG_T( { printbuf("### Saw unary minus before =>, forcing word %s\n", s); } ); OPERATOR('-'); /* unary minus */ } - PL_last_uni = PL_oldbufptr; switch (tmp) { case 'r': ftst = OP_FTEREAD; break; case 'w': ftst = OP_FTEWRITE; break; @@ -5747,6 +5746,7 @@ Perl_yylex(pTHX) break; } if (ftst) { + PL_last_uni = PL_oldbufptr; PL_last_lop_op = (OPCODE)ftst; DEBUG_T( { PerlIO_printf(Perl_debug_log, "### Saw file test %c\n", (int)tmp); |