diff options
-rw-r--r-- | t/lib/warnings/toke | 3 | ||||
-rw-r--r-- | toke.c | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/t/lib/warnings/toke b/t/lib/warnings/toke index eb918f1afd..02c6cccca4 100644 --- a/t/lib/warnings/toke +++ b/t/lib/warnings/toke @@ -304,6 +304,9 @@ You need to quote "ふれど" at - line 5. use warnings 'syntax' ; $_ = "ab" ; s/(ab)/\1/e; +s//\(2)/e; # should be exempt +s/${\2}//; # same here +()="${\2}"; # metoo no warnings 'syntax' ; $_ = "ab" ; s/(ab)/\1/e; @@ -6943,7 +6943,8 @@ Perl_yylex(pTHX) case '\\': s++; - if (PL_lex_inwhat && isDIGIT(*s)) + if (PL_lex_inwhat == OP_SUBST && PL_lex_repl == PL_linestr + && isDIGIT(*s)) Perl_ck_warner(aTHX_ packWARN(WARN_SYNTAX),"Can't use \\%c to mean $%c in expression", *s, *s); if (PL_expect == XOPERATOR) |