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::InputOutput::ProhibitReadlineInForLoop"

Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop - Write < while( $line = < ){...} >> instead of < for(<){...} >>. River stage three • 133 direct dependents • 408 total dependents

Using the readline operator in a "for" or "foreach" loop is very slow. The iteration list of the loop creates a list context, which causes the readline operator to read the entire input stream before iteration even starts. Instead, just use a "while"...

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