# New Ticket Created by  Nick Logan 
# Please include the string:  [perl #127422]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=127422 >


The following prints an incrementing count (expected):
`my $x = do { while ( 1 ) { state $a++; say $a; }; }; say $x;`
`do while ( 1 ) { state $a++; say $a; }; say $x;`

The following only prints `1`s (expected incrementing count):
`my $x = do while ( 1 ) state $a++; say $a; }; }; say $x;`


When `do` does not use braces it works as expected unless its also used in 
assignment.
When `do` does use braces it always works as expected.

Reply via email to