Given something like
foreach (keys %myHash) {
... do stuff ...
}
foreach (keys %myHash) {
... do more stuff ...
}
Is Perl guaranteed to iterate over the keys in a consistent order if the hash is not altered?
hashkeyperl
Given something like
foreach (keys %myHash) {
... do stuff ...
}
foreach (keys %myHash) {
... do more stuff ...
}
Is Perl guaranteed to iterate over the keys in a consistent order if the hash is not altered?
Best Answer
Yes. From
perldoc -f keys
:(emphasis mine)