in reply to Re: sort hash keys as numbers and maybe even more...
in thread sort hash keys as numbers and maybe even more...

Hmm, perhaps if the value used as a key has a 'hash' property, it's used as the internal hashvalue; by default it stringifies and uses the built-in hash algorithm on the string.

What order to sort keys in when listing them? Well, each and keys doesn't have any kind of order to it in the first place. If you want an order, use sort. The block argument to sort specifies the algorithm to use. The default ordering is string cmp, and that has nothing to do with hashes. That's just what you get if you sort keys.

—John