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


<masak> m: for 1..2 { ENTER { my $t = (^1000).roll; say "Setting up
$t"; NEXT say "Tearing down $t" }; say "Processing..." }
<camelia> rakudo-moar 114659: OUTPUT«Setting up
471␤Processing...␤Setting up 449␤Processing...␤»
<masak> I'm surprised the NEXT one above doesn't show "Tearing down <n>"
<moritz> masak: you didn't call next; did you?
<masak> m: for 1..2 { ENTER { my $t = (^1000).roll; say "Setting up
$t"; NEXT say "Tearing down $t" }; say "Processing..."; next }
<camelia> rakudo-moar 114659: OUTPUT«Setting up
984␤Processing...␤Setting up 97␤Processing...␤»
<masak> moritz: I don't think I have to.
<masak> moritz: there's like an implicit `next` at the end of a loop.
* masak submits rakudobug
<PerlJam> m: for 1..2 { ENTER { my $t = (^1000).roll; say "Setting up
$t"; next; NEXT say "Tearing down $t" }; }
<camelia> rakudo-moar 114659: OUTPUT«Setting up 349␤Setting up 651␤»
<PerlJam> even with the next ...
<PerlJam> :)
<PerlJam> m: for 1..2 { ENTER { my $t = (^1000).roll; say "Setting up
$t"; NEXT say "Tearing down $t" }; next; }
<camelia> rakudo-moar 114659: OUTPUT«Setting up 606␤Setting up 552␤»
<PerlJam> huh
<masak> m: for 1..2 { NEXT say "hup!" }
<camelia> rakudo-moar 114659: OUTPUT«hup!␤hup!␤»
<masak> m: for 1..2 { ENTER { NEXT say "hup!" } }
<camelia> rakudo-moar 114659: ( no output )

I would expect a NEXT phaser to bind to the loop and trigger even in
the cases where it's declared inside of another phaser, such as ENTER.

Reply via email to