in reply to Can't access hash of hashes.

You need to force the second hash to be evaluated in a hash context. That means enclosing it in %{...} (those are braces, not parens).
my %prochash; # sub call to populate hash for (my $i = 0; $i < $prochash{NumProcessors}; $i++) { foreach (keys %{$prochash{'Processor$i'}}) { print "$_ : ",$prochash{"Processor$i"}->{$_},"\n"; } }
Cheers,
Ovid

Update: Oy! That's what I get for dashing off a quick answer prior to running to work. I did not say "hash context". I wouldn't say anything like that. Would I? :( Sigh... time to inject more coffee.

Replies are listed 'Best First'.
(Guildenstern) RE: Re: Can't access hash of hashes.
by Guildenstern (Deacon) on Sep 07, 2000 at 18:47 UTC
    That was the trick! I just couldn't seem to find that information anywhere in Advanced Programming or in the Camel Book.
    So, if I understand this correctly, I could use @{...} to force something to be evaluated in a list context? Very good piece of information - I've now added it to my Perl magnetic poetry in my cube so I can be sure to remember it.

    Guildenstern
    Negaterd character class uber alles!
        Shoot. So you mean that if I have my $a = \@b;, @{...} is basically useless? I understand that keys expects a hash. Does %{...} create an anonymous hash reference out of whatever's in the braces?

        Guildenstern
        Negaterd character class uber alles!