This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix hash order dependency bug in new Module::Corelist::deprecated_in()
authorYves Orton <demerphq@gmail.com>
Mon, 12 Nov 2012 08:35:57 +0000 (09:35 +0100)
committerYves Orton <demerphq@gmail.com>
Mon, 12 Nov 2012 08:38:57 +0000 (09:38 +0100)
commit94691b809310834faf58c42ca79fa08825387969
treecac5dc6d6fb6208018ee05018e5f544fb5820fff
parent049bd5ffd62b73325d4b2e75e59ba04b3569137d
fix hash order dependency bug in new Module::Corelist::deprecated_in()

The code was doing

    $version= List::Util::min(keys %$versions);

which introduces a hash order dependency as min() returns either the first or last
(i didnt check which) of the lowest items in the list, and considers 5.011000 and
5.011 to be equivalent. Depending on the hash order it would return
either one. Hash randomization revealed this bug immediately.

Changing the function to use List::Util::minstr() eliminates the
dependency.

    $version= List::Util::minstr(keys %$versions);
dist/Module-CoreList/Changes
dist/Module-CoreList/lib/Module/CoreList.pm