The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Search results for "module:Perl::Critic::Policy::ControlStructures::ProhibitCStyleForLoops"

Perl::Critic::Policy::ControlStructures::ProhibitCStyleForLoops - Write for(0..20) instead of for($i=0; $i<=20; $i++). River stage three • 133 direct dependents • 408 total dependents

The 3-part "for" loop that Perl inherits from C is butt-ugly, and only really necessary if you need irregular counting. The very Perlish ".." operator is much more elegant and readable. for($i=0; $i<=$max; $i++){ #ick! do_something($i); } for(0..$max...

PETDANCE/Perl-Critic-1.152 - 17 Oct 2023 04:09:08 UTC
1 result (0.057 seconds)