They are equivalent for finding the max of only two values, but a single ternary operator can't be used when there are more than two values or when the number of values is not known in advance. But for only 2 values, I prefer the ternary operator.
Then, for more values, I would not be too reluctant at using sort for just a handful of values, but I would avoid it for a large list because of the overhead. So, in that latter case, I would rather use the List::Utils max function, or roll my own sequential iteration through the list if the type of max I am looking for is something more complicated than just the largest number in a list (or perhaps use the List::Utils handsome reduce function with a appropriate code block).
| [reply] [d/l] [select] |