[Israel.pm] HASH with 3 key items

Ernst, Yehuda yernst at nds.com
Thu Jun 28 05:57:26 PDT 2007

i get the info from query and i need to put it into a table/hash
and then i need to search on the table/hash if it already exits and if exists take the phone out.

-----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 Szabo
Perl Training in Israel  http://www.pti.co.il/
Perl mailing list
Perl at perl.org.il
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