in reply to How does next label work?
Naked blocks are documented as being internally implemented as loops which are only executed once.¹
next is a loop control which reevaluates the condition, which is false now.
It's no goto, you can only use if for lables just in front of loop-starts, OTOH gotos can jump to any lables in the same scope.
For your purpose better try redo
or real gotos> perl { print $x++; redo if $x<6; } __END__ 012345
> perl X: { print $x++; goto X if $x<6; } __END__ 012345
Cheers Rolf
UPDATES:
¹)from perlsyn
Basic BLOCKs A BLOCK by itself (labeled or not) is semantically equivalent t +o a loop that executes once. Thus you can use any of the loop control statements in it to leave or restart the block.
In Section
Seekers of Perl Wisdom