This one just came up: How do I break out of an if statement? I have a long if statement, but there is one situation where I can break out of it early on.
Keep your while loop so you can use lastbut also make sure that the loop is executed at most once
my $loop_once = 1;
while ( $loop_once-- and some_condition ) {
blah, blah, blah
last if $some_other_condition; # No need to continue...
blah, blah, blah
...
}