Jay Hannah <span dir="ltr">&lt;<a href="mailto:jay@jays.net">jay@jays.net</a>&gt;</span> wrote:<br>&gt; next if ($audit-&gt;{$date} &amp;&amp; $audit-&gt;{$date}-&gt;{$hotel} &amp;&amp; $audit-&gt;{$date}-&gt;{$hotel} &gt; 0);<br>
<br>Sterling Hanenkamp wrote:<br>
&gt; I usually prefer:<br>
&gt; next if ($audit-&gt;{$date}{$hotel} || 0) &gt; 0;<br>

<br>Ok, I&#39;m getting a similar issue with this bit of code:<br><span style="font-family: courier new,monospace;">55 &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } else {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">56 &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ($value, $parm)=split(/\s+/,$line,2);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">57 &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $myhash1{$section_name}{$parm} = $value;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">58 &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</span><br style="font-family: courier new,monospace;">
<br>Line 57 is spitting a lot of &quot;Use of unitialized value in hash element&quot; warnings -- I&#39;m pretty certain it&#39;s because of the newly defined %<span style="font-family: courier new,monospace;">myhash1</span> hash instantly having the $section_name and $parm keys used right away.<br>
<br>I tried putting in these lines between 56 and 57:<br><span style="font-family: courier new,monospace;">55 &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } else {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
56 &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ($value, $parm)=split(/\s+/,$line,2);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
57 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ($myhash1{$section_name} || 0);</span><br style="font-family: courier new,monospace;" clear="all"><span style="font-family: courier new,monospace;">58 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ($</span><span style="font-family: courier new,monospace;">myhash1</span><span style="font-family: courier new,monospace;">{$section_name}{$parm} || 0);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">59 &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $</span><span style="font-family: courier new,monospace;">myhash1</span><span style="font-family: courier new,monospace;">{$section_name}{$parm} = $value;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">
60 &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</span><br>...but the warnings still persist.<br><br>Aside from turning off warnings for these lines, is there a better way to handle this?&nbsp; Should I be pre-loading the &quot;$myhash1{$section_name}&quot; branch first before adding the &quot;{$parm}&quot; branch to it?<br>
<br>Dan<br clear="all"><br>-- <br>&quot;Quis custodiet ipsos custodes?&quot; (Who can watch the watchmen?) -- from the Satires of Juvenal<br>&quot;I do not fear computers, I fear the lack of them.&quot; -- Isaac Asimov (Author)<br>
** *** ***** ******* *********** *************<br>