One thing at a time all the time!

Welcome to Rocteur
Friday, April 19 2024 @ 08:29 AM CEST

How to count or increment in Perl

for ($count = 1; $count <= 5; $count++) {
print "$count\n";
}

In Perl that is usually written as:

for $count ( 1 .. 5 ) {
print "$count\n";
}


John
--
use Perl;
program
fulfillment

FAQ Manager » Perl » How to count or increment in Perl