while (1) { # use a block for structuring things { print "do something, then leave the loop\n"; last; } } #### while (1) { # use a block for structuring things (a bit unconventionally) if (1) { print "do something, then leave the loop\n"; last; } }