programming-examples/perl/Statement/A program that demonstrates the while statement.pl
2019-11-15 12:59:38 +01:00

13 lines
301 B
Perl

#!/usr/local/bin/perl
$done = 0;
$count = 1;
print ("This line is printed before the loop starts.\n");
while ($done == 0) {
print ("The value of count is ", $count, "\n");
if ($count == 3) {
$done = 1;
}
$count = $count + 1;
}
print ("End of loop.\n");