in reply to Re: Tracking down an uninitialized value warning
in thread Tracking down an uninitialized value warning
I'm suspicious of the "# Some more processing here which is not relevant" section..
Ok, well for the record - here are the lines that I removed:
Basically, I was getting a warning anytime I tried to use $status, obviously because it was undefined.my $icon = "$themepath/$status.gif"; my $testdetails = "/bb/html/$host.$test.html"; print qq(\t<th><a href="$testdetails">), qq(<img src="$icon" border="0" alt="$status" $iconsize title="$test +: $status since $duration ago">), qq(</a></th>\n);
Anyway, since posting earlier I've been out for lunch and cleared my head a bit and just taken another look at it. And I've found that if I change the conditional in the if statement to:
...the warnings disappear.if (defined $tref->{$host}{$test}{status}) {
Although this has solved my immediate problem, I'm still puzzled as to why..
..returns true in this case, yetdefined $tref->{$host}{$test}
..returns false - when I know for a fact (from the dumper output) that $tref->{$host}{$test} does not exist.defined $tref->{$host}{$test}{status}
Thanks for your feedback :)
|
|---|