Dear all:
I want to use hash to keep my records.
But before using it, I want to determine whether the value of the key exist?
Below is my source code:
if($hash{$key} eq "")
{
print "the value of the $key is empty\n";
$hash{$key}=1;
}
else
{
$hash{$key}++;
}
It works but I will receive some warning message like:
"Use of uninitialized value in string eq at
F:\driver_source\autoBuild\checkout\test6.pl line 46.
the value of the 9 is empty"
Is there any way to avoid it?
appreciate your help,
miloody
Thread Previous
|
Thread Next