Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^4: What makes an array sorted and a hash unsorted?

by ikegami (Patriarch)
on Jun 01, 2009 at 17:44 UTC ( [id://767336]=note: print w/replies, xml ) Need Help??


in reply to Re^3: What makes an array sorted and a hash unsorted?
in thread What makes an array sorted and a hash unsorted?

But what's your point? In theory, it could, but in practice, it doesn't.

My answer to Roy answers this as well.

keys and values are meant to return their values in no predictable order.

No, it's not a feature, it's a side-effect. It would be needlessly costly to return them sorted. Why is it needless? Because people would still want custom sorting of the keys. (With arrays, they want custom sorting of the values.)

  • Comment on Re^4: What makes an array sorted and a hash unsorted?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://767336]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-25 16:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found