in reply to any mechanism to go to the end of a loop but do not exit the loop
The OP indicates he knows what next does, so I assume the reason to jump to the end of the loop is in order to do something there. I also assumed that the last thing should not be done unless we're skipping to the end. Here is my suggestion:
for ($i = 0; $i < 4; $i++) { print "Start $i "; if ($i == 2) { goto TWO; } print "End\n"; next; TWO: print "Middle\n"; }
Output:
Start 0 End Start 1 End Start 2 Middle Start 3 End
|
|---|