use strict; use warnings; my $ra_web_page = [ { type => 'tag', element => 'html', attributes => { lang => 'en', }, content => [ { type => 'tag', element => 'head', attributes => { }, content => [ ], }, { type => 'tag', element => 'body', attributes => { }, content => [ { type => 'tag', element => 'h1', attributes => { }, content => [ { type => 'string', value => 'Heading 1', }, ], }, { type => 'tag', element => 'p', attributes => { id => 'para1', class => 'first-para', }, content => [ { type => 'string', value => 'This is ', }, { type => 'tag', element => 'em', attributes => { }, content => [ { type => 'string', value => 'emphasised', }, ], }, { type => 'string', value => '. And this is not.', }, ], }, ], }, ], }, ]; my $em_text = $ra_web_page->[0]{content}[1]{content}[1]{content}[1]{content}[0]{value}; print "EM text = $em_text\n";