carcassonne has asked for the wisdom of the Perl Monks concerning the following question:
Using the configuration file below I obtain a blank entry when listing all the keys in %config. Also, when adding a new section, a blank line separates the section name from the entry of that section, like this:
[FifthBlock] build: Test_2.00.002
Here's the test code:
read_config 'test2.cfg' => my %config; print Dumper(%config); $config{"FifthBlock"}{"build"} = "Test_2.00.002"; write_config %config, "test2.modified"; exit 0;
And here's the configuration file (platform is Linux - i.e. only newlines):
[MainSection] branch: FirstBlock branch: SecondBlock branch: ThirdBlock branch: FourthBlock [MainSectionBuilds] build: TestBuild-001 build: TestBuild-002 build: TestBuild-003 build: TestBuild-004 build: TestBuild-005 [FirstBlock] build: Test_1.04.001 build: Test_1.04.002 build: Test_1.04.003 build: Test_1.04.004
And here's the beginning of Dumper:
$VAR1 = ''; $VAR2 = {}; $VAR3 = 'FirstBlock'; $VAR4 = { 'build' => [
$VAR1 and $VAR2 are holding nothing. Does this have an effect on the extra newline between added section name and section entry ?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Config::Std blank entry in hash, and blank line
by TheDamian (Vicar) on Dec 14, 2005 at 19:12 UTC | |
by carcassonne (Pilgrim) on Dec 15, 2005 at 13:16 UTC | |
by TheDamian (Vicar) on Dec 15, 2005 at 22:45 UTC |