Subject: | -DefaultConfig hashref is modified |
#!/usr/bin/env perl
use strict;
use warnings;
use Config::General;
use Data::Dumper::Concise;
my %defaults = ( foo => 'bar' );
warn Dumper(\%defaults);
my %config = Config::General->new(
-ConfigFile => 'foo.conf',
-DefaultConfig => \%defaults,
)->getall;
warn Dumper(\%defaults);
The contents of foo.conf:
foo bar
output:
{
foo => "bar"
}
{
foo => [
"bar",
"bar"
]
}
As you can see the second dump of %defaults contains the merged config.