On 1/9/07, oryann9 <[EMAIL PROTECTED]> wrote:
I have a HoHoH structure that looks like after running print Dumper (\%hash);
'prlhNSSA' => {
'1499' => {
'gecos' => 'First Name Last
Name,CIS,location,
'host' => '/var/tmp/passwd.tgpdrpp1.hpux',
'gid' => '205'
}
}
};
My 1st hash is keyed by name, that accesses 2nd hash keyed by UID, that
accesses a 3rd hash keyed by remaining items: gid,gecos and hostname.
[snip]
my question is how do I access and print all values? I am trying:
foreach (keys %dub_hash) {
print %{$dub_hash->{$name}->{$uid}->{%gid}->{$gecos} };
}
Do I need three loops? What am I doing wrong?
Yup, three loops. I'll get you started:
for my $name (keys %dub_hash) {
for my $uid (keys %{$dub_hash{$name}}) {
# do stuff, note the %{...} above to force precedence
}
}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/