in reply to sort hash keys as numbers and maybe even more...
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: sort hash keys as numbers and maybe even more...
by pg (Canon) on Feb 05, 2003 at 22:57 UTC | |
by tall_man (Parson) on Feb 06, 2003 at 00:26 UTC | |
by adrianh (Chancellor) on Feb 05, 2003 at 23:07 UTC | |
|
Re: Re: sort hash keys as numbers and maybe even more...
by John M. Dlugosz (Monsignor) on Feb 07, 2003 at 20:37 UTC |