Perl::Critic::Policy::ControlStructures::ProhibitMultipleSubscripts - forbid using the same subscript multiple times in a loop
This policy as a part of the Perl::Critic::PolicyBundle::SNEZ distribution.
Conway suggests only extracting specific values of arrays and hashes in loops exactly once and assigning them to variables for later access. Not only does it make the code less cluttered with repeated lookups, it is also more efficient in many cases.
This Policy is not configurable except for the standard options.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Perl::Critic::PolicyBundle::SNEZ, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl::Critic::PolicyBundle::SNEZ
CPAN shell
perl -MCPAN -e shell install Perl::Critic::PolicyBundle::SNEZ
For more information on module installation, please visit the detailed CPAN module installation guide.