Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: danny [...] sadinoff.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.49
Fixed in: (no value)



When using -MergeDuplicateBlocks => 1 need to handle the error of attempting to use both scalars and hashes as values for a key, e.g. connect_info DBI:mysql:etc connect_info username connect_info passwd <connect_info> on_connect_do "set NAMES utf8" on_connect_do "set time_zone = 'Europe/London'" </connect_info> ..results in the unhelpful error: Error parsing /path/to/configfile.conf: Not a HASH reference at /usr/local/lib/perl5/site_perl/5.10.0/Config/General.pm line 831. reccommend instead that it say something like: In MergeDuplicateBlocks mode, care must be taken not to mix config types. The key "connect_info" has both scalars and hashes set to it, at /path/to/configfile.conf line X
Hm, I can't reproduce this. Config: blah = 1 blah = 2 <blah> y = 1 </blah> Script: #!/usr/bin/perl use lib qw(blib/lib); use Config::General; use Data::Dumper; my ($config, $path) = @ARGV; my $cfg = new Config::General(-ConfigFile => $config, -ExtendedAccess => 1, -MergeDuplicateBlocks => 1, -MergeDuplicateOptions => 1); print "Full: \n" . Dumper($cfg->getall()); Output: $ ./path.pl x.cfg Config::General: Cannot create hashref from <blah> because there is already a scalar option 'blah' with value '2' at ./path.pl line 6
case closed.