Implementation wise, how do you do this? Do you start off with a numerical sort, then redo the sort partway through if you detect a string? Do you require that lists be marked as containing only numbers? How do you handle tied variables or objects that can numify and stringify at will?
I don't think it's easy, and that's why the second sentence of perlfunc for sort says:
If SUBNAME or BLOCK is omitted, "sort"s in standard string comparison order.
In reply to Re: sort hash keys as numbers and maybe even more...
by chromatic
in thread sort hash keys as numbers and maybe even more...
by pg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |