develooper Front page | perl.beginners | Postings from September 2009

Re: Hash of Hashes

Thread Previous | Thread Next
From:
Shawn H Corey
Date:
September 29, 2009 02:56
Subject:
Re: Hash of Hashes
Message ID:
4AC1D990.2020300@gmail.com
Soham Das wrote:
> How can I create a Hash of Hashes from two lists. Is it possible?
> 
> I want the effective functionality to be served like this
> 
> $ChildHash["Joe"]["21A"]="Sally"
> 
> i.e Joe at 21A has a child called Sally. List1 here will be the name of Parents, List2 here will contain the house number. 

Hashes use {}, arrays use []

$ChildHash{"Joe"}{"21A"} = "Sally";


-- 
Just my 0.00000002 million dollars worth,
   Shawn

Programming is as much about organization and communication
as it is about coding.

I like Perl; it's the only language where you can bless your
thingy.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About