Subject: | Invalid config file written |
Date: | Tue, 19 May 2015 21:12:39 +0200 |
To: | bug-config-general [...] rt.cpan.org |
From: | Jeffrey Ratcliffe <jeffrey.ratcliffe [...] gmail.com> |
The following code demonstrates a hash which not only does not
round-trip when saved with Config::General, but also produces an
invalid config file:
#!/usr/bin/perl
use warnings;
use strict;
use Config::General;
my $text = "Some have not been saved.\nDo you really want to quit?";
my %hash =
( message => { $text => { switch => 1, swatch => 0 } }, other_key => 1 );
my $rc = 'test';
if ( not -r $rc ) { system "touch $rc" }
my $conf = Config::General->new(
-ConfigFile => $rc,
);
$conf->save_file( $rc, \%hash );
my %new_hash = $conf->getall;