Change 18687 by sky@sky-tibook on 2003/02/10 18:13:29
Subject: Re: [perl #20716] [FIX] scope error with brackets
From: Enache Adrian <[EMAIL PROTECTED]>
Date: mon feb 10, 2003 18:48:58 Europe/Stockholm
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Affected files ...
... //depot/perl/t/comp/parser.t#5 edit
... //depot/perl/toke.c#460 edit
Differences ...
==== //depot/perl/t/comp/parser.t#5 (text) ====
Index: perl/t/comp/parser.t
--- perl/t/comp/parser.t#4~18251~ Fri Dec 6 13:27:55 2002
+++ perl/t/comp/parser.t Mon Feb 10 10:13:29 2003
@@ -9,7 +9,7 @@
}
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 @@
}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
};
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");
+}
==== //depot/perl/toke.c#460 (text) ====
Index: perl/toke.c
--- perl/toke.c#459~18674~ Sat Feb 8 10:22:42 2003
+++ perl/toke.c Mon Feb 10 10:13:29 2003
@@ -6287,6 +6287,8 @@
funny, dest, funny, dest);
}
}
+ if (PL_lex_inwhat == OP_STRINGIFY)
+ PL_expect = XREF;
}
else {
s = bracket; /* let the parser handle it */
End of Patch.