in reply to Re^4: beginner - ordering tuples
in thread beginner - ordering tuples
why has it put some of the output in single quotes:
The input array is initialised with strings. Left unmodified, all the values would be output in quotes.
During the sort process, any values that are compared as numbers using <=>, will first be converted, internally, to their (binary) numeric representation.
But as the first & last pairs in your example have unique first elements (1 & 12), there is never any need to compare their second elements, hence they are never converted to numeric representation, and so are output as strings.
|
|---|