Wednesday 2 December 2009

Hash tests

Determine whether a hash value exists, is defined, or is true :

1.print "Value EXISTS, but may be undefined.\n" if exists $hash{ $key };
2.print "Value is DEFINED, but may be false.\n" if defined $hash{ $key };
3.print "Value is TRUE at hash key $key.\n" if $hash{ $key };

No comments:

Post a Comment

Tweets by @sriramperumalla