From 9d58dbc453a86c9cbb3a131adcd1559fe0445a08 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Tue, 10 Mar 2015 22:00:41 -0700 Subject: [PATCH] [perl #123963] "@" If an @ sign in a double-quoted string is not followed by a valid identifier, then it is treated literally. Or at least that is how it was intended to work. The lexer was actually not self-consistent. It was treating non-ASCII digits at valid identifiers in determining where the interpolation started, but was not treating them as valid identifiers when actually parsing the interpolated code. So this would result in syntax errors, and even crashes in some cases. --- t/op/lex.t | 5 ++++- toke.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/t/op/lex.t b/t/op/lex.t index 7785445..8314f41 100644 --- a/t/op/lex.t +++ b/t/op/lex.t @@ -7,7 +7,7 @@ use warnings; BEGIN { chdir 't' if -d 't'; require './test.pl'; } -plan(tests => 23); +plan(tests => 24); { no warnings 'deprecated'; @@ -199,3 +199,6 @@ fresh_perl_is( { stderr => 1 }, '<\L\L> with no newline [perl #123802]' ); + +is eval "qq'@\x{ff13}'", "\@\x{ff13}", + '"@" [perl #123963]'; diff --git a/toke.c b/toke.c index 9715f0e..bfcb060 100644 --- a/toke.c +++ b/toke.c @@ -3056,7 +3056,7 @@ S_scan_const(pTHX_ char *start) (@foo, @::foo, @'foo, @{foo}, @$foo, @+, @-) */ else if (*s == '@' && s[1]) { - if (isWORDCHAR_lazy_if(s+1,UTF)) + if (UTF ? isIDFIRST_utf8((U8*)s+1) : isWORDCHAR_A(s[1])) break; if (strchr(":'{$", s[1])) break; -- 1.8.3.1