summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--t/comp/parser.t10
-rw-r--r--toke.c2
2 files changed, 11 insertions, 1 deletions
diff --git a/t/comp/parser.t b/t/comp/parser.t
index 40ae5f18cf..88f933c7a6 100644
--- a/t/comp/parser.t
+++ b/t/comp/parser.t
@@ -9,7 +9,7 @@ BEGIN {
}
require "./test.pl";
-plan( tests => 12 );
+plan( tests => 15 );
eval '%@x=0;';
like( $@, qr/^Can't modify hash dereference in repeat \(x\)/, '%@x=0' );
@@ -66,3 +66,11 @@ eval {
}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
};
is( $@, '', 'PL_lex_brackstack' );
+
+{
+ undef $a;
+ undef @b;
+ my $a="a"; is("${a}{", "a{", "scope error #20716");
+ my $a="a"; is("${a}[", "a[", "scope error #20716");
+ my @b=("b"); is("@{b}{", "b{", "scope error #20716");
+}
diff --git a/toke.c b/toke.c
index 4cc5d4cccd..d8e53b508b 100644
--- a/toke.c
+++ b/toke.c
@@ -6287,6 +6287,8 @@ S_scan_ident(pTHX_ register char *s, register char *send, char *dest, STRLEN des
funny, dest, funny, dest);
}
}
+ if (PL_lex_inwhat == OP_STRINGIFY)
+ PL_expect = XREF;
}
else {
s = bracket; /* let the parser handle it */