<div>Wow, did I stump all the Perl experts, or did everyone go on vacation? ;-)</div>
<div> </div>
<div>Another thought I had: Is it possible to "define $hash{$key}" manually without assigning a value to it? (i.e. the opposite of "undef $hash{$key}")</div>
<div> </div>
<div>Dan<br></div>
<div class="gmail_quote">On Tue, Jan 13, 2009 at 9:07 AM, Dan Linder <span dir="ltr"><<a href="mailto:dan@linder.org">dan@linder.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="Ih2E3d">Jay Hannah <span dir="ltr"><<a href="mailto:jay@jays.net" target="_blank">jay@jays.net</a>></span> wrote:<br>> next if ($audit->{$date} && $audit->{$date}->{$hotel} && $audit->{$date}->{$hotel} > 0);<br>
<br></div>
<div class="Ih2E3d">Sterling Hanenkamp wrote:<br>> I usually prefer:<br>> next if ($audit->{$date}{$hotel} || 0) > 0;<br><br></div>Ok, I'm getting a similar issue with this bit of code:<br><span style="FONT-FAMILY: courier new,monospace">55 } else {</span><br style="FONT-FAMILY: courier new,monospace">
<span style="FONT-FAMILY: courier new,monospace">56 ($value, $parm)=split(/\s+/,$line,2);</span><br style="FONT-FAMILY: courier new,monospace"><span style="FONT-FAMILY: courier new,monospace">57 $myhash1{$section_name}{$parm} = $value;</span><br style="FONT-FAMILY: courier new,monospace">
<span style="FONT-FAMILY: courier new,monospace">58 }</span><br style="FONT-FAMILY: courier new,monospace"><br>Line 57 is spitting a lot of "Use of unitialized value in hash element" warnings -- I'm pretty certain it'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 } else {</span><br style="FONT-FAMILY: courier new,monospace"><span style="FONT-FAMILY: courier new,monospace">56 ($value, $parm)=split(/\s+/,$line,2);</span><br style="FONT-FAMILY: courier new,monospace">
<span style="FONT-FAMILY: courier new,monospace">57 ($myhash1{$section_name} || 0);</span><br style="FONT-FAMILY: courier new,monospace" clear="all"><span style="FONT-FAMILY: courier new,monospace">58 ($</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 $</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 }</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? Should I be pre-loading the "$myhash1{$section_name}" branch first before adding the "{$parm}" branch to it?<br>
<br>Dan<br clear="all"><font color="#888888"><br>-- <br>"Quis custodiet ipsos custodes?" (Who can watch the watchmen?) -- from the Satires of Juvenal<br>"I do not fear computers, I fear the lack of them." -- Isaac Asimov (Author)<br>
** *** ***** ******* *********** *************<br></font></blockquote></div><br><br clear="all"><br>-- <br>"Quis custodiet ipsos custodes?" (Who can watch the watchmen?) -- from the Satires of Juvenal<br>"I do not fear computers, I fear the lack of them." -- Isaac Asimov (Author)<br>
** *** ***** ******* *********** *************<br>