Welcome to the monastery.
I changed your code a little and I hope that might help you. I also suggest to read perllol and perlreftut.
#!/usr/bin/perl use Data::Dumper; $hohref = {}; $hohref->{"h1"}={}; $hohref->{"names"}={"name1"=>"Chandra"}; $epout = rand(9); $tcid = substr($epout,4,9); $hohref->{$tcid}={"TCDesc" => "Login Test", "TCRun"=>"Yes","TCResult"= +>"Pass"}; #Dereferencing Hash of Hashes using foreach loops foreach my $k1 (keys %$hohref) { print "The key outer hash $k1 The value outer hash $hohref->{$k1}\n" +; if (ref($hohref->{$k1}) eq "HASH") { foreach my $k2 (keys %{$hohref->{$k1}}) { print "The key is $k2 ===> The value is $hohref->{$k1}->{$k2}\n" +; } } } #Dereferencing using Dumper function is working print Dumper($hohref),"\n";
In reply to Re: Retriving data from Hash of Hashes
by pme
in thread Retriving data from Hash of Hashes
by chandraspola
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |