in reply to Re^2: HOH again.. and tr/// and more..
in thread HOH again.. and tr/// and more..

As phrased that is a meaningless question. You can access a hash in sorted order by iterating through a sorted list of keys, but the hash itself is unsorted - that's the nature of the beast.

You can sort an array because each element in the array has a defined position - it's index. But generally that is unimportant for a hash. There are tied hash implementations that allow itteration over the hash keys in sorted order and that may be what you want, but it may not either. At the end of the day the answer depends implicitley on what you are trying to achieve so there is no one answer to "how do I sort a hash?".


DWIM is Perl's answer to Gödel