Donnerstag, 20.12.2007, 05:57:34 Uhr
until in Perl
The until -command repeats a block, until a expression is true.
A simple example:
This little example prints the numbers 0-9.
The use of next , last and redo is possible.
Is the expression of until true, before the first loop begins, the code-block will not be processed.
If you want, that the code-block is processed at least once, you can use the form do{} until ();
This example prints the 10, althoug $i is 10 from beginning. The loop is processed one time .
Be careful, until can become a endless loop very easy, in case the expression in (..) is never true.
Until is the part of while , which processes a code-block, as long as the expression is true.
Thema: Sonstiges Perl
Der Beitrag "" wurde 4912 mal gelesen.
Zufällige Beiträge im /blog/perl
0.021920919418335 sec. to build ...Blogsoftware in pure Perl - Powered by a lot of Coffee...