in reply to Access Complex Hash

On the other hand, if we assume that the square brackets in key3 are a typographic error, as it probably is, then the answer to the question would be straightforward, such as:

print $$hash{'key1'}{'key2'}{'key3'}; ==> will print "Hello"

If you want to iterate through the structure, you might use the keys function, and, since this function requires a hash argument, you might have to tell Perl explicitly that this is what it is, e.g. noting the underlined text below:
keys %{$$hash{'key1'}{'key2'}}

Finally, note that $$hash{'key'} is a shorthand, a favorite of mine, that also could have been written $hash->{'key'}.

Notice that in my example the hash-keys are string literals as they must be.   If you had omitted the quotes, Perl would interpret them as so-called barewords, and, if you did not use use strict; use warnings;, you might not be advised of the issue.   Perl might interpret them as (undefined...) variables and produce nothing useful.

Data::Dumper is always your friend.

HTH ...

Replies are listed 'Best First'.
Re^2: Access Complex Hash
by perl@1983 (Sexton) on May 15, 2012 at 13:48 UTC
    Thanks for the detailed explanation! It was really helpful!

      Happy to be of service.

      Now, your number one take-away from all this should be ... use strict; use warnings; !!

      Perl is one of those very-powerful tools in which “the price you pay” is that sometimes it is not immediately obvious what it is actually doing, because it tends to assume that you do understand.   While this is a perfectly valid approach for The Implementors to have taken, it can also spell a lot of frustration “when, in fact, you don’t. understand.”   (That certainly was the case for me!   So, mind you, I am not being “an apologist” here!   Merely a bringer of Fair Warning...)   HTH.™