Just another Perl shrine | |
PerlMonks |
Re: Re: Re: Adding additional values to a hash of an hash ?by djantzen (Priest) |
on Nov 12, 2002 at 20:21 UTC ( [id://212393]=note: print w/replies, xml ) | Need Help?? |
What you're talking about then is a hash of arrays of hashes. $data{$formname} now returns a reference to the array, and to access an individual hash table in the array you can say something like: $data{$formname}->[0]{type}. Basically, what you're doing is a hash lookup to grab the array reference pointed to by $formname, then using an array index to obtain a reference to the nested hash whose data you need to access, and then doing a normal hash lookup there on 'type'.
In Section
Seekers of Perl Wisdom
|
|