Hash keys have no predefined ordering. Any given call to keys() will present the keys as a list which will, at that instant, have an order, but that particular ordering is neither persistent nor stable nor predictable in the face of insertions and deletions. Rapid searching for hash keys has nothing to do with ordering, but rather with the nature of hash functions. Ideally, any given key value hashes to a unique value in the hash that can be found (or the existence of tested for) in constant time. Searching an ordered list is going to be O(log n) or worse.

If that were true, finding an item in an array would take logarithmic time (this thread has already established arrays are sorted). It doesn't of course, given the key, it takes constant time to find something in an array.

Just because binary search on a list of sorted values is logarithmic doesn't mean any search is logarithmic.

You appear to be conflating being ordered with being sorted and searching with
simple access.

Arrays are ordered. The elements have a defined order. Orderedness
and sortedness are not the same thing. One speaks to the intrinsic sequencing of
the elements of a collection (orderedness) while the other speaks to an externally
imposed sequencing of the elements of a collection (sortedness).

Searching for an element is different from accessing an element. In the first case, you
don't know which element is the target, so you have to find it. Accessing a specific
element means you have the index of the item already. For a hash, the index is a string;
for an array, the index is an integer.

You cannot speak generally of the intrinsic sequence of the elements of a hash. It is
not a fixed quantity. Adding or removing elements can change the sequence in ways that
are not readily predictable. Iterating over the elements first involves collecting
the set of keys. That act turns them into a list which has an intrinsic order, but
it's no longer a hash or a set. The set of keys has become an ordered n-tuple (where
n is the number of keys), but it's no longer a set.

You cannot speak generally of the intrinsic sequence of the elements of a hash. It is not a fixed quantity

It most certainly is. Each hash element is mapped to a bucket using a fixed function: hash(key,seed,nr_of_bufs). key is the key to be hashed, seed is fixed at program start, and nr_of_bufs is the current number of buffers used. But there's no randomness involved in the hash function. Given the same input parameters, the result will always be the same. It's a deterministic function. Arrays can be seen as a special case, where the "hash" function is just sub hash {0+$_[0]}.