Welcome to the Monastery | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
> Again, there is no "TRUE list" of hash keys. To generate keys %hash, Perl has to traverse the entire internal hash table and return a list of the results to you. But again, Perl does this very, very quickly.
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
UPDATESorry ... looks like I had an incorrect or outdated source according to https://www.cpan.org/authors/id/G/GA/GAAS/illguts-0.09.pdf
and I'm not sure if this is still up to date, since new security requirements led to more randomization
Cheers Rolf In reply to Re^2: can I change hash keys or values directly (UPDATED)
by LanX
|
|