http://www.perlmonks.org?node_id=992072


in reply to while loop question

Are you looking for something more elegant than the following ugly code that would do the trick?

my $LastFlag = 0; while (CONDITION) { ... if (END_CONDITION) { $LastFlag = 1; last; } } if (not $LastFlag) { ... }