megaurav2002 has asked for the wisdom of the Perl Monks concerning the following question:
I have created a hoh as below:
my %hoh = ( a => { a1 => { a11 => 1, a12 => 1, }, b1 => { b11 => 1, b12 => 1, }, c1 => 1, }, b => { --- some elements like above--- }, );
Now i have a get accessor for this, which returns
return $hoh{'a'};
What i understand is that it should return the whole hash which is value for key a. But i am getting only the first element 'a1' i.e.
a1 => { a11 => 1, a12 => 1, }
Any ideas why this is happening?
Thanks,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: hash question
by GrandFather (Saint) on Dec 12, 2008 at 00:39 UTC | |
by megaurav2002 (Monk) on Dec 12, 2008 at 00:57 UTC | |
by GrandFather (Saint) on Dec 12, 2008 at 01:02 UTC | |
by quester (Vicar) on Dec 12, 2008 at 05:11 UTC |