[Solved] How is a for loop written in Perl?


There are two types of for loop in perl, in addition to the for statement modifier. They look like this:

# c-style for loop
for ( my $i = 0; $i < 12; ++$i ) {
    ...
}

# regular for loop
for my $i (0..11) {
    ...
}

# statement modifier
... for 0..11;

solved How is a for loop written in Perl?