summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--t/op/postfixderef.t5
-rw-r--r--toke.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/t/op/postfixderef.t b/t/op/postfixderef.t
index 41d35ef9e0..96dcf0f3f4 100644
--- a/t/op/postfixderef.t
+++ b/t/op/postfixderef.t
@@ -16,7 +16,7 @@ BEGIN {
use strict qw(refs subs);
-plan(118);
+plan(121);
{
no warnings qw 'deprecated syntax';
@@ -367,4 +367,7 @@ is "$_->@{foo}", "foo->7 8 9", '->@{ does not interpolate without feature';
is "foo$_->@*bar", "foo7 8 9bar", '->@* interpolated w/other stuff';
is "foo$_->@[0,1]bar", "foo7 8bar", '->@[ interpolated w/other stuff';
is "foo$_->@{foo}bar", "foooofbar", '->@{ interpolated w/other stuff';
+ is "@{[foo->@*]}", "7 8 9", '->@* inside "@{...}"';
+ is "@{[foo->@[0,1]]}", "7 8", '->@[ inside "@{...}"';
+ is "@{[foo->@{foo}]}", "oof", '->@{ inside "@{...}"';
}
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++;
}