in reply to The strange ordering of hash values

Hashes have no intrinsic order of their elements. See perlfaq4, or type perldoc -q order on your command prompt to see how to get a hash that remembers the order you put the elements into it. Maybe you want an array instead?

Replies are listed 'Best First'.
Re^2: The strange ordering of hash values
by Anonymous Monk on Apr 19, 2007 at 17:18 UTC
    Thanks a lot for all comments posted here.
    looking into the above code, How can we say the output will be "3" .... Is that possible?
    Thanks

      If you want to print three, here you go,

      print "3";

      I think a better question would be, WHY do you want the answer to be 3. We cannot help if you cannot explain what you attempting to do.

        Herkum,
        sorry ... I am trying to clarify my doubt, without execution, can anyone say the output for the code is 3? that was my question. Is that possible?