"be consistent" | |
PerlMonks |
Re: Hashes do preserve insertion order after allby roboticus (Chancellor) |
on Jul 31, 2019 at 16:16 UTC ( [id://11103652]=note: print w/replies, xml ) | Need Help?? |
No, it's letting you sort by the address, as you mention. So it's giving you the creation order instead of the insertion order.
Here, I'm inserting the same items into another hash in a different order, yet it returns the same order as the first.
The creation order isn't guaranteed, either. Once you start adding and deleting objects over a longer time period, deleted chunks of memory can be reused later breaking the correlation of address and creation time. ...roboticus When your only tool is a hammer, all problems look like your thumb.
In Section
Meditations
|
|