http://www.perlmonks.org?node_id=91119

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I had an if statement where I checked to make sure that two values were both == 1. Even when the values were initialized, it gave me the unitialized value warning. So I copy/pasted the if and printed it directly above the line that had the if.
Code portion: print "$SERVER{$key}{one} == 1 && $SERVER{$key}{two} == 1\n"; if($SERVER{$key}{one} == 1 && $SERVER{$key}{two} == 1){ .. .. Run: 0 == 1 && 0 == 1 Use of uninitialized value in numeric eq (==) at blah.pl line 244.
Whats up with this? I didn't want to use the weenie method and localize the warning variable to stop this warning; what is the correct way to fix this? Thanks.