> -----Original Message-----
> From: AL H [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, October 18, 2001 1:51 PM
> To: [EMAIL PROTECTED]
> Subject: return a hash key
> 
> 
> Let say I have a multikey hash:
> $poeple{$first}{$Last}{$MI}{$CITY}
> If I am passing values to this hash Is there a function or a 
> way to retrieve 
> missing keys from it?
> I know that if  (! exists %poeple ->{$first}->{$Last}-{$MI}) 
> will return 
> false or true.
> I want thes non valid keys temselves to be returned.
> Regards

Actually, 

   ! exists %poeple ->{$first}->{$Last}-{$MI}

is not valid syntax. I assume you meant

   !exists $poeple{$first}->{$Last}->{$MI}

which can be shortened to

   !exists $poeple{$first}{$Last}{$MI}

This expression will auto-vivify $people{$first} and
$people{$first}{$Last} if they don't already exist
(but NOT $poeple{$first}{$Last}{$MI}).

Is this really your data model? Why all the nested
levels of hashes?

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

Reply via email to