|
|
|
|
|
by jcynix
331 days ago
|
|
I can't remember a time where "keys %hash" returned the keys in a defined order. And I've been using Perl for over 30 years now. I've just consulted my first issue of "Programming Perl" (printed in 1990l and it says: keys (assoc ARRAY) this function returns a normal array consisting of all the keys of the named associative array. The keys are returned in an apparently random order, but it is the same order as either the values() or each() function produces (given that the associative array has not been modified) |
|
It was never a _defined_ order, but before version 5.17.6 (November 2012), each hash returned its list of keys and values in a _consistent_ order between runtimes, so some code ended up getting written that depended on this ordering (say in a unit test, or a list that would get assigned into a database). The change was to make the ordering random/inconsistent/unpredictable every time the list was fetched, which as I recall did break some number of tests in CPAN modules and required new releases.