Dermot :
Hi All,

I am unsure if the following statement is going to do what I want.

I want to test if there is a value in $hash_ref{'someval'} NOT if the
key is defined. I'd also like to avoid un-sightly "undefined value"
errors.

So which of the following is best:


if (defined($hash_ref{'someval'}) {}


I may think this is the better way.
also you can check perldoc -f exists and find something like:

    print "Exists\n"   if exists $hash{$key};
    print "Defined\n"  if defined $hash{$key};
    print "True\n"      if $hash{$key};

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to