in reply to Re^3: Save the resultant of " hash sorted by values "
in thread Save the resultant of " hash sorted by values "

Yes, the point is that he's not sorting on the correct values (most likely) and he can certainly use a function to translate the keys just as well as using a ST.

No. You must use the function (or equivalent). Whether ST is used or not has no bearing on whether it works or not.

With STWithout ST
With functionWorksWorks
Without functionDoesn't workDoesn't works

As an aside, using ST doesn't only make the code more complex, I suspect it also makes the makes it slower in this case.

  • Comment on Re^4: Save the resultant of " hash sorted by values "

Replies are listed 'Best First'.
Re^5: Save the resultant of " hash sorted by values "
by wind (Priest) on Mar 23, 2011 at 22:43 UTC

    I feel you're reading more into my words than is there. If you'd like me to be more clear

    Yes, the point is that he's not sorting on the correct values (most likely) and he can certainly use a function to translate the keys within the sort block just as well as using a ST to precache the correctly translated keys.

    Didn't talk at all about what's a function and what isn't one. My main point is and was only that his sort order was probably not what he wanted. The means of fixing it is up to him, I just provided a single example.

    Nevertheless, thanks again for sharing alternative methods.

    Cheers