Skip Menu |

This queue is for tickets about the Config-General CPAN distribution.

Report information
The Basics
Id: 56370
Status: resolved
Priority: 0/
Queue: Config-General

People
Owner: Nobody in particular
Requestors: jjnapiork [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 2.45
Fixed in: (no value)



Subject: Latest Config::General doing funky reordering of arrayrefs
Basically something changed in 2.45 causing funky sorting of array refs. For example: ----------------- John-Napiorkowski-MacBook-Pro:Freestock johnn$ cpanm http://search.cpan.org/CPAN/authors/id/T/TL/TLINDEN/Config-General-2.44.tar.gz Fetching http://search.cpan.org/CPAN/authors/id/T/TL/TLINDEN/Config-General-2.44.tar.gz ... OK Configuring Config-General-2.42 ... OK Building and testing Config-General-2.42 for http://search.cpan.org/CPAN/authors/id/T/TL/TLINDEN/Config-General-2.44.tar.gz ... OK Successfully installed Config-General-2.42 John-Napiorkowski-MacBook-Pro:Freestock johnn$ perl -MConfig::General -MData::Dump -e 'warn $Config::General::VERSION; my $serialized = Config::General->new(-ConfigHash=>{a=>[qw/one two three/]})->save_string; warn Data::Dump::dump(Config::General->new(-String=>$serialized)->getall)' 2.44 at -e line 1. ("a", ["one", "two", "three"]) at -e line 1. John-Napiorkowski-MacBook-Pro:Freestock johnn$ cpanm Config::General Fetching http://search.cpan.org/CPAN/authors/id/T/TL/TLINDEN/Config-General-2.45.tar.gz ... OK Configuring Config-General-2.45 ... OK Building and testing Config-General-2.45 for Config::General ... OK Successfully installed Config-General-2.45 (upgraded from 2.44) John-Napiorkowski-MacBook-Pro:Freestock johnn$ perl -MConfig::General -MData::Dump -e 'warn $Config::General::VERSION; my $serialized = Config::General->new(-ConfigHash=>{a=>[qw/one two three/]})->save_string; warn Data::Dump::dump(Config::General->new(-String=>$serialized)->getall)' 2.45 at -e line 1. ("a", ["one", "three", "two"]) at -e line 1. ---------------- As you can see, in version 2.44 the arrayref ['one', 'two', 'three'] gets roundtripped properly, but in version 2.45 looks like it is sorting the array, maybe alphabetically? I've marked this as critical since a lot of stuff depends on Config::General and a lot of those modules are not passing tests. Plus I have to imagine any reordering of arrays is going to cause trouble. Willing to help if you can point me to a repo I can commit to. John Napiorkowski
Fixed in 2.46: yes, the _store() function have been rewritten and there was a sort() call left. Sorry. It now checks for subarrays too if -SaveSorted is turned on and keeps the array untouched if it is turned off.