See the ternaryconditional operator for one solution.
$max = ($x < $max) ? $max : $x; # similar for min
or the postfix if:
$max = $x if ($x > $max);
Update: you may also want to pay attention to the initial value if it is not defined. Your min value may always be 0 unless you have minimum values that are less than the default value for undef.
--MidLifeXis
In reply to Re^3: Analytics on Hash Arrays
by MidLifeXis
in thread Analytics on Hash Arrays
by yasser8@gmail.com
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |