Questions about this topic? Sign up to ask in the talk tab.

Perl/Basics/Loops/Until

From NetSec
Jump to: navigation, search
  • An until loop executes until a condition is true.
my $switch;
my $counter;
until (defined $switch) {
    print $counter;
    $counter++;
    $switch = 1 if ($counter > 100);
}
 The above code will execute until $switch is defined.