in reply to order of hash

Perhaps before answering this question, you should first understand how does a hashing algorithm work.

The simplest form of a hash has a hashing function and an array of linked-list of predetermined size. The hashing function is not random at all. It takes in the parameters such as storage array size, search key, etc, and generates an index pointing to a fixed location in the array. The output of the hashing function is repeated for the same input parameters. In a single level hash, the input data is then inserted into the linked-list at the given location in the storage array.

Why is the hash-function not random? The reason is simple: if the computed storage array index returned by the hash-function is random for a given search key, you will never get back the data you stored in the first place.

Given the nature of the hash key, the hash function is carefully selected so that it minimises collisions in hash keys, ie., for different input parameters, minimise the number of times the same storage array index is selected. Thus giving a more balanced hash.

The benefit of using a hash is to maximize the speed of storage and retrieval of data based on a search key.

There are lots of research papers on hash and hashing functions. Google on hashing algorithm, and you will get hundreds of hits.

Knowing that a hash has a non-random hashing function, I think it is clear that Perl hash is not random, and the hash built for the same input data is always in the same order.