Perl::Critic::Policy::ValuesAndExpressions::ProhibitMixedBooleanOperators3pm
Write " !$foo && $bar || $baz " instead of " not $foo && $bar or $baz".
Affiliation
This Policy is part of the core Perl::Critic distribution.
Overview
Conway advises against combining the low-precedence booleans ( "and or not" ) with the high-precedence boolean operators ( "&& || !" ) in the same expression. Unless you fully understand the differences between the high and low-precedence operators, it is easy to misinterpret expressions that use both. And even if you do understand them, it is not always clear if the author actually intended it.
next if not $foo || $bar; #not oknext if !$foo || $bar; #oknext if !( $foo || $bar ); #ok
Configuration
This Policy is not configurable except for the standard options.
Releases
10 releases since Debian 5.0 (Lenny); the text changed 9 times.