{ last unless (my $once = $condition1) and $condition2; while(1) { # ... # ... last if $once or not $condition3; } }