diff options
-rw-r--r-- | t/comp/parser.t | 10 | ||||
-rw-r--r-- | toke.c | 2 |
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"); +} @@ -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 */ |