Robert Arnold wrote:

> NOW, my question is this: If I can traverse the hash and look for a key
> which is equal to "OrgName", why can't I simply print: $response{'OrgName'} ?
> It just seems there should be a quicker, simpler way than having to
> traverse the whole hash.

Good question.  Why not.  I use hashes all the time, amd never have to do
anything more than $hashref->{$key} for any given level of dereferencing.  If I
am actually addressing a hash name directly [very rare]  I use $hashname{$key}.

Have you had problems using the direct form.  What you are doing defeats the
entire purpose of a hash.


> I'm guessing the answer has something to do with referencing/dereferencing,
> which is a new subject for me. The perldoc says that $response is "a
> reference to a hash containing all information provided by the whois
> registrar".

Use the arrow operator.  See syntax above.  Or you could:
$$hashname{$key}
But I have come to see that as relatively ugly.  If you get tused to the arrow
operator, it will start to speak to you.

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to