in reply to Mysterious hash behaviour

Hashes are unordered. If you want the keys ordered, use sort keys %sortListArr. Another solution is to use Tie::IxHash, Tie::IxHash::Easy or Tie::DxHash.
Boris

Replies are listed 'Best First'.
Re^2: Mysterious hash behaviour
by tsam (Novice) on Apr 07, 2005 at 07:06 UTC
    sort keys %sortListArr works pretty good. Thanx:)
Re^2: Mysterious hash behaviour
by Limbic~Region (Chancellor) on Apr 07, 2005 at 13:26 UTC
    borisz,
    I agree with you but feel you have left out some information that may result in misunderstandings. Insert order (which the modules you listed are good at) is often not the same as a desired sorted order. That is why I created Tie::Hash::Sorted. In this particular case, Tie::IxHash also can do naive sorts that meet the stated requirements but fail if gets any more complicated.

    Cheers - L~R