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.
EXPECT
Use of literal control characters in variable names is deprecated at (eval 1) line 1.
Use of literal control characters in variable names is deprecated at (eval 2) line 1.
+########
+# toke.c
+# [perl #120288] -X at start of line gave spurious warning, where X is not
+# a filetest operator
+-a;
+;-a;
+EXPECT
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;
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);