Bucle while en perl

Ejemplos de código

1
0

perl bucle do while

# Basic syntax:
do {
   code to run;
} while( condition );

# Example usage:
$i = 5;
do {
   print "Value of i: $i\n";
   $i += 1;
} while( $i < 10 );
# Note, do..while loops are very similar to while loops except that they
#	always execute at least once
1
0

perl hasta que el ciclo

# Basic syntax:
until( condition ) {
   code to run;
}

# Example usage:
$i = 5;
until( $i > 10 ) {
   print "Value of i: $i\n";
   $i += 1;
}
# Note, until loops are kind of the opposite of whiles loop, they loops over 
# 	the code until the condition becomes true

En otros idiomas

Esta página está en otros idiomas

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................