Frankly, your question doesn't make sense. The entire point
of a do {} until loop is to repeat the loop
until the condition is met. When would you stop anyway?
How will you know the condition will never be met? (In general,
you cannot not - that's what the halting problem is about).
Abigail | [reply] [Watch: Dir/Any] [d/l] |
Count iterations of failure, at a set count, exit..
| [reply] [Watch: Dir/Any] |
How to exit ??
alst is not working
| [reply] [Watch: Dir/Any] |
#! perl
use strict;
use warnings;
my $n = 42;
{
do
{
printf "n = %d\n", $n--;
last if $n == 37;
} until ($n <= 0);
}
print "Past the loop\n";
Output:
0:22 >perl 878_Tutorial.pl
n = 42
n = 41
n = 40
n = 39
n = 38
Past the loop
0:22 >
Hope that helps,
| [reply] [Watch: Dir/Any] [d/l] [select] |
You can have a certain number of tries based on the number of values in the database:
$dbnumber=66; #This would be the number of usernames.
$value=1;
do{
#Your input line would go here, obviously not print value.
$value=$value+1;
} until($value==$dbnum); #This makes it stop after checking the last value in the database.
| [reply] [Watch: Dir/Any] |