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

Perl/Basics/Loops/Until

From NetSec
Revision as of 02:58, 16 July 2012 by AlizaLorenzo (Talk | contribs) (Created page with "* An '''until''' loop executes '''until''' a condition is '''true'''. {{code|text=<source lang="perl">my $switch; my $counter; until (defined $switch) { print $counter; $...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.