Package: perl-Perl-Critic-Policy-Variables-ProhibitLoopOnHash (0.008-bp160.1.4)
Don't write loops on hashes, only on keys and values of hashes
When "looping over hashes," we mean looping over hash keys or hash values. If you forgot to call 'keys' or 'values' you will accidentally loop over both. foreach my $foo (%hash) {...} # not ok action() for %hash; # not ok foreach my $foo ( keys %hash ) {...} # ok action() for values %hash; # ok An effort is made to detect expressions: action() for %hash ? keys %hash : (); # ok action() for %{ $hash{'stuff'} } ? keys %{ $hash{'stuff'} } : (); # ok (Granted, the second example there doesn't make much sense, but I have found a variation of it in real code.)
Package information
- Homepage
- [https://metacpan.org/release/Perl-Critic-Policy-Variables-ProhibitLoopOnHash]
- License
- Artistic-1.0 OR GPL-1.0-or-later
- Downstream package maintainer
- Unknown: not reported in the indexed source
- Source package
- [perl-Perl-Critic-Policy-Variables-ProhibitLoopOnHash]
- Software project
- [libperl-critic-policy-variables-prohibitlooponhash-perl]
Versions and downloads for perl-Perl-Critic-Policy-Variables-ProhibitLoopOnHash
| Version / release | Architecture / repository | Package size | Installed size | Files | Publisher repository artifact |
|---|---|---|---|---|---|
| 0.008-bp160.1.4leap-16.0 / oss | noarchopenSUSE Leap 16.0 · OSS · multi-architecture | 21 KiB | 28 KiB | list of files | perl-Perl-Critic-Policy-Variables-ProhibitLoopOnHash-0.008-bp160.1.4.noarch.rpm |
About these downloads
Each row is recorded package-index metadata for one version, architecture, suite, and repository. Names, URLs, and sizes are source-reported; a link is a potentially mutable retrieval location, not an OpenFactory redistribution claim or proof that OpenFactory retained the artifact bytes.
Dependencies and recommendations for perl-Perl-Critic-Policy-Variables-ProhibitLoopOnHash
dep: perl(:MODULE_COMPAT_5.42.0)
Package not available
dep: perl(List::Util) (>= 1.33)
Package not available
dep: perl(Perl::Critic) (>= 1.126)
Package not available
dep: perl(parent)
Package not available
Package file paths (11)
Paths come from the repository package-file index for the observed builds. They describe archive/package associations, not every file that will exist on a running system after maintainer scripts, alternatives, generated state, diversions, or installation choices.
- /usr/lib/perl5/vendor_perl/5.42.0/Perl
- /usr/lib/perl5/vendor_perl/5.42.0/Perl/Critic
- /usr/lib/perl5/vendor_perl/5.42.0/Perl/Critic/Policy
- /usr/lib/perl5/vendor_perl/5.42.0/Perl/Critic/Policy/Variables
- /usr/lib/perl5/vendor_perl/5.42.0/Perl/Critic/Policy/Variables/ProhibitLoopOnHash.pm
- /usr/share/doc/packages/perl-Perl-Critic-Policy-Variables-ProhibitLoopOnHash
- /usr/share/doc/packages/perl-Perl-Critic-Policy-Variables-ProhibitLoopOnHash/Changes
- /usr/share/doc/packages/perl-Perl-Critic-Policy-Variables-ProhibitLoopOnHash/README
- /usr/share/licenses/perl-Perl-Critic-Policy-Variables-ProhibitLoopOnHash
- /usr/share/licenses/perl-Perl-Critic-Policy-Variables-ProhibitLoopOnHash/LICENSE
- /usr/share/man/man3/Perl::Critic::Policy::Variables::ProhibitLoopOnHash.3pm.gz
Field source: openSUSE Leap 16.0 OSS
