Hi Miloody,
Try:
if (defined $hash{$key}) {
...
Ray
loody wrote:
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"
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/