in reply to Re: Re: Re: Re: Re: Back to Remedial Perl for Me: map{} function
in thread Back to Remedial Perl for Me: map{} function

The ordering of elements in a hash is based on the hash function. The hash function processes a key and determines where in the hash that key should be placed. For any given key, the hash function must always return the same result. A good hash function will tend to keep keys spread out in the hash; if all the keys end up in the same place in the hash, then you lose the benefit of having a hash.

So, there is an "order" to the elements in the hash, but the order is not intended to be useful to the programmer, and keys may be reordered when the size of the hash changes.

  • Comment on Re: Re: Re: Re: Re: Re: Back to Remedial Perl for Me: map{} function