<?xml version="1.0" encoding="windows-1252"?>
<node id="516734" title="Re: Config::Std blank entry in hash, and blank line" created="2005-12-14 14:12:25" updated="2005-12-14 09:12:25">
<type id="11">
note</type>
<author id="107600">
TheDamian</author>
<data>
<field name="doctext">
&lt;blockquote&gt;&lt;i&gt;
Using the configuration file below I obtain a blank entry when listing all the keys in %config.
&lt;/i&gt;&lt;/blockquote&gt;

That's because every config file starts with the "nameless" section. As soon as you name a section, it shifts to that section instead but, even if your first line is a section marker, there will still be an entry for the nameless section (which had no data) in the resulting hash.

&lt;p&gt;Arguably however, that's unintuitive, and the nameless section ought not appear in the resulting hash unless it has actual contents. I'll patch the next release to work that way.

&lt;blockquote&gt;&lt;i&gt;
Also, when adding a new section, a blank line separates the section name from the entry of that section
&lt;/i&gt;&lt;/blockquote&gt;  

Yes, that's the standard behaviour. And, no, there's currently no way of altering it. I guess &lt;tt&gt;read_config&lt;/tt&gt; could look at the input file's layout and intuit whether you're separating section markers from config variables. I'll look at adding that behaviour too.

&lt;p&gt;Damian</field>
<field name="root_node">
516639</field>
<field name="parent_node">
516639</field>
</data>
</node>
