in reply to Can't figure out the realtive ordering.
The elements of a hash can be obtained in some-sorted order using the each() function, with certain limitations. And, you will sometimes see while loops which iterate over sort keys(hashvar).
The elements of an array do not change position, unless elements are inserted or removed. The ordering of a hash should be considered by you to be “unpredictable.” (A hash is designed to champion rapid and consistent access-speed, and retrieval order is the price that you pay.)