Skip Menu |

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

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

People
Owner: tlinden [...] cpan.org
Requestors: SHLOMIF [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.43
Fixed in: (no value)



Subject: Error inputting an array whose first element is a string and its second is a hash-ref.
Attached is a Test::More script that dies with Config-General-2.43. What happens is that I'm using something like: MyKey MyValue <MyKey> Key2 Value2 </MyKey>
Subject: config-general-1.t
#!/usr/bin/perl use strict; use warnings; use Test::More tests => 1; use Config::General; use YAML::XS qw(DumpFile); my $conf = Config::General->new(-String => <<'EOF'); <Controller::Distribution> graph_path __HOME__/root/dist/graph/ </Controller::Distribution> name CPANHQ <Model::DB> connect_info dbi:SQLite:dbname=__HOME__/cpanhq.db connect_info undef </Model::DB> <Production> Test hello <Test> One Two Three Four </Test> </Production> EOF my %values = $conf->getall(); # TEST is_deeply ( $values{'Production'}{'Test'}, [ "hello", { One => "Two", Three => "Four", }, ], "Production is OK." );
While I could "fix" this (in fact: this is not a bug, it behaves as designed), it would break several other existing things, eg. test #43 in t/run.t using t/cfg.43. To make it right, I'd have to rewrite the code in a way, that it also allowes arrays of scalars and hashrefs in mix, eg. 2 or more scalars and 2 or more hashrefs in one arrayref. I'm actually not sure, if this would break any existing code out there, while I do indeed agree that it would be an improvement to support such configs. So, I'm thinking about this...
Sorry, I will not change the code to make this work. It will change too much the existing code (and running systems), which would need too much time.