in reply to (Ovid) Re: Can't access hash of hashes.
in thread Can't access hash of hashes.

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!

Replies are listed 'Best First'.
RE: (Guildenstern) RE: Re: Can't access hash of hashes.
by merlyn (Sage) on Sep 07, 2000 at 18:51 UTC
      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!
        $a=\@b;
        So $a is now a reference to a list. How do you access that list? @$a But of course, this kind of dereferencing can get confusing, easily typoed, etc. so you say: @{$a} It's all in perlref

        No, @{$refToArray} is the way to get the whole array when given a reference to an array. It just isn't called "forcing a list context".

                - tye (but my friends call me "Tye")