summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorSADAHIRO Tomoyuki <BQW10602@nifty.com>2006-07-25 09:15:50 +0900
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-07-26 20:32:08 +0000
commit1749ea0d81e275f5160a584ab9e554a4acc871e8 (patch)
tree6b24beb3e47d2188e6bf5ab1ef1a0d7dc13fca72 /toke.c
parent9ae4231fec23eab01ed1d777fb74f1070512d4d7 (diff)
downloadperl-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.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/toke.c b/toke.c
index 7bed30b696..b3688bb2e5 100644
--- a/toke.c
+++ b/toke.c
@@ -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.