Index | index by Group | index by Distribution | index by Vendor | index by creation date | index by Name | Mirrors | Help | Search |
Name: perl-Perl-Critic-Policy-Variables-ProhibitLoopOnHash | Distribution: openSUSE Leap 15.2 |
Version: 0.008 | Vendor: openSUSE |
Release: lp152.1.1 | Build date: Fri Feb 21 11:08:44 2020 |
Group: Development/Libraries/Perl | Build host: lamb02 |
Size: 29109 | Source RPM: perl-Perl-Critic-Policy-Variables-ProhibitLoopOnHash-0.008-lp152.1.1.src.rpm |
Packager: https://bugs.opensuse.org | |
Url: https://metacpan.org/release/Perl-Critic-Policy-Variables-ProhibitLoopOnHash | |
Summary: 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 % ? keys % : (); # ok (Granted, the second example there doesn't make much sense, but I have found a variation of it in real code.)
Artistic-1.0 OR GPL-1.0-or-later
* Tue Apr 23 2019 Stephan Kulow <coolo@suse.com> - updated to 0.008 see /usr/share/doc/packages/perl-Perl-Critic-Policy-Variables-ProhibitLoopOnHash/Changes 0.008 2019-04-22 16:44:54+03:00 Asia/Jerusalem * GH #3: Some typo fixed. (Jakub Wilk) * Wed Apr 03 2019 Stephan Kulow <coolo@suse.com> - initial package 0.007 * created by cpanspec 1.78.09
/usr/lib/perl5/vendor_perl/5.26.1/Perl /usr/lib/perl5/vendor_perl/5.26.1/Perl/Critic /usr/lib/perl5/vendor_perl/5.26.1/Perl/Critic/Policy /usr/lib/perl5/vendor_perl/5.26.1/Perl/Critic/Policy/Variables /usr/lib/perl5/vendor_perl/5.26.1/Perl/Critic/Policy/Variables/ProhibitLoopOnHash.pm /usr/lib/perl5/vendor_perl/5.26.1/x86_64-linux-thread-multi /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
Generated by rpm2html 1.8.1
Fabrice Bellet, Tue Jul 9 11:27:19 2024