Name : perl-Perl-Critic-Policy-Variables-ProhibitLoopOnHash
| |
Version : 0.008
| Vendor : openSUSE
|
Release : lp152.1.1
| Date : 2020-02-21 11:08:49
|
Group : Development/Libraries/Perl
| Source RPM : perl-Perl-Critic-Policy-Variables-ProhibitLoopOnHash-0.008-lp152.1.1.src.rpm
|
Size : 0.03 MB
| |
Packager : https://bugs_opensuse_org
| |
Summary : Don\'t write loops on hashes, only on keys and values of hashes
|
Description :
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 % ? keys % : (); # ok
(Granted, the second example there doesn\'t make much sense, but I have found a variation of it in real code.)
|
RPM found in directory: /vol/rzm3/linux-opensuse/ports/aarch64/distribution/leap/15.2/repo/oss/noarch |