[Israel.pm] HASH with 3 key items

Ernst, Yehuda yernst at nds.com
Thu Jun 28 05:58:32 PDT 2007


can you explain in plain words what you have writen? 

$phonebook{$address}{$name}{$title} 

is it hash of hash?

-----Original Message-----
From: perl-bounces at perl.org.il [mailto:perl-bounces at perl.org.il]On Behalf Of Gabor Szabo
Sent: Thursday, June 28, 2007 3:53 PM
To: Perl in Israel
Subject: Re: [Israel.pm] HASH with 3 key items


On 6/28/07, Ernst, Yehuda <yernst at nds.com> wrote:
> Hello!
>
> I want to manage a list with 3 key items
>
> i want ( adders , name , title  = > phone)
> i need to check my list and  only if the 3 matches i need to extract the phone number
> can i do it with hash or i need something else?

I guess you have the information in some sort of file or database so
if you managed to extract the 4 pieces of information you can then write:

my %phonebook;
loop_over_file {
   $phonebook{$address}{$name}{$title} = $phone;
}



Gabor
-- 
Gabor Szabo
http://www.szabgab.com/
Perl Training in Israel  http://www.pti.co.il/
_______________________________________________
Perl mailing list
Perl at perl.org.il
http://perl.org.il/mailman/listinfo/perl
*************************************************************************************
This e-mail is confidential, the property of NDS Ltd and intended for the addressee only.  Any dissemination, copying or distribution of this message or any attachments by anyone other than the intended recipient is strictly prohibited.  If you have received this message in error, please immediately notify the postmaster at nds.com and destroy the original message.  Messages sent to and from NDS may be monitored.  NDS cannot guarantee any message delivery method is secure or error-free.  Information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses.  We do not accept responsibility for any errors or omissions in this message and/or attachment that arise as a result of transmission.  You should carry out your own virus checks before opening any attachment.  Any views or opinions presented are solely those of the author and do not necessarily represent those of NDS.

To protect the environment please do not print this e-mail unless necessary.
**************************************************************************************




More information about the Perl mailing list