in reply to complicated data structures

Advanced Perl Programming: The first two chapters are a very good introduction to complex data structures. You can also find some other good chapters about some different topics.

Mastering Algorithms with Perl: Not only data structures (chapters 2 and 3), but almost everything you need to deal with them.

About your example, getting "h" for $var->{e}->{f}->{g}; is as easy as:

my $var; $var->{e}->{f}->{g} = "h";
You can search "autovivification" to know why this works.