Syntactic Confectionery Delight | |
PerlMonks |
Re^2: What makes an array sorted and a hash unsorted?by ikegami (Patriarch) |
on Jun 01, 2009 at 17:07 UTC ( [id://767324]=note: print w/replies, xml ) | Need Help?? |
So if keys sorted the keys before returning them, the hash would be considered sorted? nah.
keys may not return the keys in order, but it could. "f" is not suddenly less than "b" because keys decides to return foo before bar. Again, it can't be that hashes aren't ordered simply because Perl doesn't provide a builtin function to return them sorted like it does for arrays.
Nit:
Perl can and will return them in the same order in some circumstances, even after the 5.8.1 change to add randomisation.
In Section
Meditations
|
|