[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Associative Arrays of Arrays?



Hey.  I've got a general Perl-related question: I'm trying to create an
associative array containing associative arrays; for example:

   $hashref = { "section" , { "key"  , "value" },
                "GLOBAL"  , { "key2" , "value2"} };

This works fine (as a definition) -- however, I can't seem to get the 'keys'
function to work on this!

   keys($hashref)    [or any other variant I try...]

creates compiler errors complaining I'm trying to access a non-hash object.

I can get data in, I just can't get it back out!

Actually, this:
   printf "section:key -> %s\n", $$hashref{"section"}{"key"} ;
works fine. [  'keys $$hashref' doesn't work, either! ]

I'm sure there's a simple way to do this.  Can anyone help me!?

Thanks.
  --Dennis