I understand that the hash is not ordered in perl. It bothers me if I can depend on the keys and values that occur with the index relation.
Say I have this hash
my %h = ("a" => 1, "b" => 2, "c" => 3, "d" => 4);
If I do keys %h, I can get
("b", "a", "d", "c")
Will it be guaranteed to values %hcome out in the same order to match the keys? Can i expect
(2, 1, 4, 3)
Or is there no guarantee that there is any index relation between keys %hand values %h?
source
share