I am reading somebody else's code, always a good learning process. The code is 
about a telephone contact list.  The intent of this line of code is clear: 
'does the logged in person have a cell phone, and does the cell phone have the 
attribute line=dc'

There is one confusing step in the syntax:

 if ((@{$info{$loggedin}}{cell}) and                   
                (@{$info{$loggedin}}{line} eq 'dc'))
 {stuff to
 execute}


When I read the condition, this is what I see:

a) $loggedin is scalar

b) $loggedin is used as a hash key

c) info is a hash

d) since we retrieve on thing from the hash, there is a '$' in front of info

e)  $info{$loggedin} is enclosed inside @{}

f) @{} is a way of derefencing an array reference.

g) $info{$loggedin} is inside @{},  so we have @{$info{$loggedin}}

h) does @{$info{$loggedin}}  evaluate to an array?  That would confuse me 
because {cell} imposes {} on an array?

i) does @{$info{$loggedin}}{cell} retrieve something from a hash?  Also a 
confusion, because of the @

j) Where am I going wrong????

All help appreciated...

[EMAIL PROTECTED]

 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to