Philipp Traeder wrote:
Gunnar Hjalmarsson wrote:
Your wording "if a hash contains an element" is ambigous IMO. A
hash or associative array consists of key/value pairs, where the
keys are indexes and the values are considered to be the elements
(I think).
Ok - that's a possible terminology, and yes, I wasn't completely
precise ;-)
It's just that I think you must be precise to really understand this.
If you ask me, you can't put up a general rule about using "exists"
or "defined" - it's a questions of how/on which conditions the hash
has been filled...
exists() is about the key, while defined() is about the corresponding
value, i.e. about what $hash{key} returns.
John's pointer to the applicable FAQ answer may be helpful.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>