diff options
author | SADAHIRO Tomoyuki <BQW10602@nifty.com> | 2006-07-25 09:15:50 +0900 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-07-26 20:32:08 +0000 |
commit | 1749ea0d81e275f5160a584ab9e554a4acc871e8 (patch) | |
tree | 6b24beb3e47d2188e6bf5ab1ef1a0d7dc13fca72 /toke.c | |
parent | 9ae4231fec23eab01ed1d777fb74f1070512d4d7 (diff) | |
download | perl-1749ea0d81e275f5160a584ab9e554a4acc871e8.tar.gz |
interpolation of @- (and @+) in patterns ([perl #27940] comes back)
Message-Id: <20060725001517.3C5D.BQW10602@nifty.com>
p4raw-id: //depot/perl@28620
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -1994,9 +1994,14 @@ S_scan_const(pTHX_ char *start) /* check for embedded arrays (@foo, @::foo, @'foo, @{foo}, @$foo, @+, @-) */ - else if (*s == '@' && s[1] - && (isALNUM_lazy_if(s+1,UTF) || strchr(":'{$+-", s[1]))) - break; + else if (*s == '@' && s[1]) { + if (isALNUM_lazy_if(s+1,UTF)) + break; + if (strchr(":'{$", s[1])) + break; + if (!PL_lex_inpat && (s[1] == '+' || s[1] == '-')) + break; /* in regexp, neither @+ nor @- are interpolated */ + } /* check for embedded scalars. only stop if we're sure it's a variable. |