summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-10-30 06:18:20 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-10-30 16:54:17 -0700
commite37958c391a6e98df6ad46860e1c472070272046 (patch)
treef883a95da83f08c2ee97ae64897f5cc485f60da8 /toke.c
parenta9e3f35916a989e6c527206f43af85f49ef58cbb (diff)
downloadperl-e37958c391a6e98df6ad46860e1c472070272046.tar.gz
Eliminate ‘Can't use \1 to mean $1’ false positives
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.
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/toke.c b/toke.c
index 2ed27a9dee..4ba35ac98f 100644
--- a/toke.c
+++ b/toke.c
@@ -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)