In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/7bb20a136f11264ca165cb28a8f4c7358d55de6d?hp=b740ac3840efd0f189beebdbeef9666d70b90408>
- Log ----------------------------------------------------------------- commit 7bb20a136f11264ca165cb28a8f4c7358d55de6d Author: Brian Fraser <[email protected]> Date: Sat Sep 21 10:30:48 2013 -0300 Test that ${foo{bar}} and ${\nfoo{bar}} mean the same thing. This was changed to consistently parse as $foo{bar} in a49b10d0a8. Previously, it would parse to either that or ${(foo {bar})}, depending on the presence of newlines, and the existence of a sub foo with prototype (&). ----------------------------------------------------------------------- Summary of changes: t/uni/variables.t | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/t/uni/variables.t b/t/uni/variables.t index 28d0eb0..c8e6c8c 100644 --- a/t/uni/variables.t +++ b/t/uni/variables.t @@ -12,7 +12,7 @@ use utf8; use open qw( :utf8 :std ); no warnings qw(misc reserved); -plan (tests => 65878); +plan (tests => 65880); # ${single:colon} should not be valid syntax { @@ -273,3 +273,18 @@ EOP is($^Q, 24, "...even if we access the variable through the caret name"); is(\${"\cQ"}, \$^Q, '\${\cQ} == \$^Q'); } + +{ + # Prior to 5.19.4, the following changed behavior depending + # on the presence of the newline after '@{'. + sub foo (&) { [1] } + my %foo = (a=>2); + my $ret = @{ foo { "a" } }; + is($ret, $foo{a}, '@{ foo { "a" } } is parsed as @foo{a}'); + + $ret = @{ + foo { "a" } + }; + is($ret, $foo{a}, '@{\nfoo { "a" } } is still parsed as @foo{a}'); + +} -- Perl5 Master Repository
