Name : perl-Perl-Critic-Policy-BuiltinFunctions-ProhibitReturnOr
| |
Version : 0.01
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : 1.58
| Date : 2024-08-05 20:25:04
|
Group : Development/Libraries/Perl
| Source RPM : perl-Perl-Critic-Policy-BuiltinFunctions-ProhibitReturnOr-0.01-1.58.src.rpm
|
Size : 0.02 MB
| |
Packager : (none)
| |
Summary : Check for \"return $x or ...\"
|
Description :
\'return\' when encountered in an expression returns from the enclosing subroutine, without evaluating the rest of the expression. So a lower-precedence operator (\'or\', \'and\', \'xor\') won\'t get evaluated after a \'return\'. This most commonly appears as the mis-idiom:
return $x or die \'Aaaagh! $x was zero!\';
Instead, use the higher-precedence \'||\' operator, like this:
return $x || die \'Aaaagh! $x was zero!\';
Or separate the two operations, like this:
$x or die \'Aaaagh! $x was zero!\'; return $x;
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-P/openSUSE_Tumbleweed/noarch |