Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hash of a Hash of a Hash of an array 1

Status
Not open for further replies.

mwhamilton

Technical User
Jan 28, 2002
11
US
Hi, this is going to sound crazy, but I am in need of help. I am trying to printout a hash of a hash of a hash of an array and I need help. Here is what the hash looks like. Any help would be greatly appreciated. Thanks!
Output needs to be:
m2: des
mikeh 8 25
rainer 32 97
kevin 25 68.5
pt
ownby 32 87
ect,


%Total_Hash = (
"m2" => {
"des" => {
"mikeh" => [8, 25],
"rainer"=> [32, 97],
"kevin"=> [25, 65.8],
},
"pt" => {
"ownby" => [32, 78],
},
"apps" => {
"clifs" => [45, 100],

},
},

"m3" => {
"des" => {
"rainer" => [2, 3],
"hho" => [25, 65],
},
"pt" => {
"ownby" => [2,23],
},
"apps" => {
"clifs" => [23, 45],
},
},
);


for $project ( keys %Total_Hash ){
for $group (keys %{$Total_Hash{$project}}) {
printf("%s: %s\n", $proj, $group);
## Need help with printing out the last hash of
## arrays.
for $user (keys %{$Total_Hash{%{$project}}}){
printf("%-8s%s\n","",$user);
}

}
 
for $user (keys %{$Total_Hash{m2}->{des}})
{
# stuff
}
would give you mikeh, rainer, and kevin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top