Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Answer: How do I make a hash of hashes?

by da w00t (Sexton)
on Feb 23, 2000 at 01:20 UTC ( #3891=categorized answer: print w/replies, xml ) Need Help??

Q&A > Data Structures > How do I make a hash of hashes? - Answer contributed by da w00t

If it was declared as a named hash of multiple dimensions, you may access it like $hash{foo}->{bar}->{beer}="free";, or like this: $hash{foo}{bar}{beer}="free"; if you prefer to drop the arrows.

If it's an anonymous hash held in a hash reference, you access it like this:

$r_hash->{foo}{bar}{beer}= "free";

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
[choroba]: Config might be better than grepping -V
[Corion]: Also see Config::V, which is less of that hackery, or that hackery hidden in a module ;)
[1nickt]: The problem was with Perlbrew
[Corion]: Whoops - Config::Perl::V
[1nickt]: I found that when using Perlbrew as recommended, with cpanminus in the system perl lib, such tests were failing to detect the data about the perl that was the install destination.

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2017-10-18 15:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (249 votes). Check out past polls.

    Notices?