Enache Adrian wrote: > > The '\n' causes yylex() to switch to the 0 case, and consequently > clobber PL_last_lop. So the test at toke.c:3473 will fail - and > '$' won't be changed into '%'. Looks correct. Thanks, applied as #18986. I added a test, in the most simple way I could find : ==== //depot/perl/t/comp/parser.t#7 (text) ==== @@ -9,7 +9,7 @@ } require "./test.pl"; -plan( tests => 20 ); +plan( tests => 21 ); eval '%@x=0;'; like( $@, qr/^Can't modify hash dereference in repeat \(x\)/, '%@x=0' ); @@ -88,3 +88,12 @@ ${a}{ ${a}[ @{b}{ ${a}{ } + +# Bug #21575 +# ensure that the second print statement works, by playing a bit +# with the test output. +my %data = ( foo => "\n" ); +print "#"; +print( +$data{foo}); +pass();Thread Previous | Thread Next