From: Adrian M. Enache Date: Mon, 10 Feb 2003 18:13:29 +0000 (+0000) Subject: Re: [perl #20716] [FIX] scope error with brackets X-Git-Tag: accepted/trunk/20130322.191538~24816 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=437fd2104756c25dedf68c6e31cd29ecbf0e2569;p=platform%2Fupstream%2Fperl.git Re: [perl #20716] [FIX] scope error with brackets Message-id: <20030210174858.GA872@ratsnest.hole> p4raw-id: //depot/perl@18687 --- diff --git a/t/comp/parser.t b/t/comp/parser.t index 40ae5f1..88f933c 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 4cc5d4c..d8e53b5 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 */