programming-examples/perl/Statement/The while command.pl

15 lines
289 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#The while command loops while a condition is true.
#So long as the condition remains true, all of the commands inside the block execute again and again.
#while (condition) {
# # ...
#}
#!/usr/bin/perl -w
$i = 0;
while ($i < 10) {
print "Iteration $i.\n";
$i++;
}