[$b, $a]->[$a <= $b]
It takes advantage of the fact that Perl doesn't have a boolean return type for true or false, so the comparison operators return 1 or 0 for true and false, respectively, which are then used by this code to index the array ref.
To get the maximum of the two values, just flip the operator to >=
No comments:
Post a Comment