Sorry, but from my understanding this is incorrect.
There is a Linked List with keys and values in a fixed randomized order which is used by iterators like each , as well as keys and values
There is also a C-Array of "Buckets" for quick look up via hash-function, and these "Buckets" also point to a Linked List with all entries having the same hash-value aka "Collisions".
But this array is not traversed to generate the output for keys
Sorry ... looks like I had an incorrect or outdated source
according to https://www.cpan.org/authors/id/G/GA/GAAS/illguts-0.09.pdf
* RITER, EITER: The first two fields are used to implement a single iterator over the + elements in the hash. RITER which is an integer index into the array referenced by ARRAY an +d EITER which is a pointer to an HE. In order find the next hash element one would first + look at EITER->next and if it turns out to be NULL, RITER is incremented until ARRAY[RITE +R] is non-NULL. The iterator starts out with RITER = -1 and EITER = NULL.
and I'm not sure if this is still up to date, since new security requirements led to more randomization
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
In reply to Re^2: can I change hash keys or values directly (UPDATED)
by LanX
in thread can I change hash keys or values directly
by misterperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |