Subject: | Parsed simplified INI files should be written as normal INI files |
When I load an INI file that has no sections, Config::Simple treats it
as simplified INI, which is correct. However, when I add sections to the
configuration an try to write it back, Config::Simple should recognize
the added section and therefore generate normal INI format (with
[sections]) instead of writing the contents of the added block in the
configuration globally (no in a section).
Example:
---------------
[jkramer/unknown:~]# cat foo.ini
test=123
[jkramer/unknown:~]# cat foo.pl
use Config::Simple;
my $cfg = new Config::Simple('foo.ini');
$cfg->param(-block => 'myblock', -values => { foo => 'bar', baz => 123 });
$cfg->write;
[jkramer/unknown:~]# perl foo.pl
[jkramer/unknown:~]# cat foo.ini
; Config::Simple 4.58
; Sun May 10 12:16:27 2009
baz=123
foo=bar
test=123
--------------