if (exists ($hashArray{$var})){ print "$var exists in the hash.\n"; print "Its value is $hashArray{$var}\n"; }