Comparing multiple numerical values in Perl -
say have few variables, $x, $y, $z, $a, $b, $c
, , want make sure have same value.
can test if ($x == $y == $z == $a == $b == $c)
avoid multiple binary comparisons, i.e. (if $x == $y , $x == $z , $y == $z ...
)?
is there way can comparing 1 short , simple test?
if ( grep $x != $_, $y, $z, $a, $b, $c ) { print "not same\n"; }