Re: [perl #20716] [FIX] scope error with brackets
authorAdrian M. Enache <enache@rdslink.ro>
Mon, 10 Feb 2003 18:13:29 +0000 (18:13 +0000)
committerArtur Bergman <sky@nanisky.com>
Mon, 10 Feb 2003 18:13:29 +0000 (18:13 +0000)
Message-id: <20030210174858.GA872@ratsnest.hole>

p4raw-id: //depot/perl@18687

t/comp/parser.t
toke.c

index 40ae5f1..88f933c 100644 (file)
@@ -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 (file)
--- 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 */