programming-examples/perl/Statement/While loop counter.pl
2019-11-15 12:59:38 +01:00

20 lines
324 B
Perl

#!c:\perl\bin
print "\n\nHere is the pre-increment example: \n";
$count = 0;
while ($count < 5)
{
print "The value of \$count is " . ++$count . "\n";
}
print "\n\nHere is the post-increment example: \n";
$count = 0;
while ($count < 5)
{
print "The value of \$count is " . $count++ . "\n";
}