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

Thank you very much for your answer Im sure it will help me very much. But I would also like to know a simpler thing: Just how to sort an internal hash of an HOH numericaly, the beta-keys or whatever one should call them. I have looked at some examples but, not found what Im looking for, maybee it is so easy nobody cares to make examples of it.

Replies are listed 'Best First'.
Re^3: HOH again.. and tr/// and more..
by GrandFather (Saint) on Mar 07, 2006 at 02:54 UTC

    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