summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-09-16 12:49:12 -0700
committerRicardo Signes <rjbs@cpan.org>2013-10-05 14:20:10 -0400
commit760ca74635309e90553eeb15e5ac62e6f19f5d86 (patch)
tree4250acb83b909872a1ee567e813962be25da6240 /toke.c
parent1f25714ad0c0126e303a12bd7ba010ac61b5e716 (diff)
downloadperl-760ca74635309e90553eeb15e5ac62e6f19f5d86.tar.gz
Fix a bug with ->@ inside "@{...}"
When encountering ->@[ or ->@{, we should only record that we are going to need a POSTJOIN at the top level of interpolation, not inside any brackets. Otherwise the ->@[ can interfere with an outer "@{...}", causing syntax errors.
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/toke.c b/toke.c
index 5d3fdce4f9..f9977d24ec 100644
--- a/toke.c
+++ b/toke.c
@@ -2186,7 +2186,9 @@ S_postderef(pTHX_ char const funny, char const next)
PL_bufptr+=2;
}
else {
- if ('@' == funny) PL_lex_dojoin = 2;
+ if ('@' == funny && PL_lex_state == LEX_INTERPNORMAL
+ && !PL_lex_brackets)
+ PL_lex_dojoin = 2;
PL_expect = XOPERATOR;
PL_bufptr++;
}