http://www.perlmonks.org?node_id=1057498


in reply to A "simple" question regarding accessing a value in a complex data structure.

The odd number of hash elements warnings arises from the fact that there is only one key? Thanks

Yes, a key without a value, specifically  { q/Expert's Guide to Scala/ },

my $hashref = { 'hasherefs', 'are', 'made', 'with', 'curly', 'braces', 'they', 'like', 'to', 'come', 'in', 'pairs' };

Here is another way to initialize , the rehohy way

my %tgs; $tgs{articles}{Python}{Programming}{"Expert's Guide to Scala"} = undef; #d3 $tgs{articles}{Perl} = "Perl Programming for Biologists"; #d1 $tgs{articles}{Java} = "How to Program in Java"; #d1 $tgs{eBooks}{Linux} = "Linux: A Beginner's Guide"; #d1

And wouldn't you know it, its also a way to access certain elements :)

See also references quick reference