traveler has asked for the
wisdom of the Perl Monks concerning the following question:
I have a Windows/DOS style INI file that I want to process. I decided to use Config::Simple because I have used it before and it is simple :-). The problem is that the file has blank lines e.g.
The module sets foo.Baz to Boo. I mailed the maintainer, but haven't heard anything. Does anyone know if there is something I can do to read such files?
Are you using the latest version? I just got version 3.50 and it seems to do the correct thing. The only other suggestion after taking a *real* quick look at the code is make sure that there aren't any spaces at the end of the lines.
Yep, I tried blank lines, spaces at the end of the lines with no values and things are still humming along as I expect them to.
#!/usr/bin/perl -w
use Config::Simple;
my $cfg = new Config::Simple( "testini.dat" );
die "Config file failure" if not defined $cfg;
%config = $cfg->vars();
my $bar = $cfg->param("FOO.Bar");
my $baz = $cfg->param("FOO.Baz");
print "<$bar>, <$baz>\n";