How to Install and Uninstall perl-Perl-Critic-Policy-Variables-ProhibitLoopOnHash Package on openSuSE Tumbleweed

Last updated: December 28,2024

1. Install "perl-Perl-Critic-Policy-Variables-ProhibitLoopOnHash" package

This guide covers the steps necessary to install perl-Perl-Critic-Policy-Variables-ProhibitLoopOnHash on openSuSE Tumbleweed

$ sudo zypper refresh $ sudo zypper install perl-Perl-Critic-Policy-Variables-ProhibitLoopOnHash

2. Uninstall "perl-Perl-Critic-Policy-Variables-ProhibitLoopOnHash" package

Please follow the guidelines below to uninstall perl-Perl-Critic-Policy-Variables-ProhibitLoopOnHash on openSuSE Tumbleweed:

$ sudo zypper remove perl-Perl-Critic-Policy-Variables-ProhibitLoopOnHash

3. Information about the perl-Perl-Critic-Policy-Variables-ProhibitLoopOnHash package on openSuSE Tumbleweed

Information for package perl-Perl-Critic-Policy-Variables-ProhibitLoopOnHash:
-----------------------------------------------------------------------------
Repository : openSUSE-Tumbleweed-Oss
Name : perl-Perl-Critic-Policy-Variables-ProhibitLoopOnHash
Version : 0.008-1.21
Arch : noarch
Vendor : openSUSE
Installed Size : 28.2 KiB
Installed : No
Status : not installed
Source package : perl-Perl-Critic-Policy-Variables-ProhibitLoopOnHash-0.008-1.21.src
Upstream URL : https://metacpan.org/release/Perl-Critic-Policy-Variables-ProhibitLoopOnHash
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 %{ $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.)