We need to check that the quote-like operator we are parsing is a sub-
stitution (not just any quote-like operator) and that we are parsing
the right-hand side.
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;
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)