mwhamilton
Technical User
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);
}
}
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);
}
}