use strict; use warnings; my $chapters = [ { title => 'Basic', page => [ { paragraph => 'lesson1'}, { paragraph => 'lesson2'}, ], }, { title => 'Advanced', page => [ { paragraph => 'lesson3'}, { paragraph => 'lesson4'}, ], }, ]; ### since we started with a scalar to hold ### an anonymous array ref, we have to ### use the little 'arrow' notation print $chapters->[0]{title}; ### basic print "\n---------------\n"; print $chapters->[1]{title}; ### advanced print "\n---------------\n"; print $chapters->[1]{page}[0]{paragraph}; ### lesson3 print "\n---------------\n"; print $chapters->[1]{page}[1]{paragraph}; ### lesson4 print "\n---------------\n";