use strict; use warnings; use Data::Dumper; use XML::Simple; my $ref = XMLin('test.xml'); print Dumper($ref->{"env:Body"}->{"m:markupvalidationresponse"}->{"m:errors"}->{"m:errorlist"}->{"m:error"}); #### $VAR1 = [ { 'm:line' => '11', 'm:col' => '66', 'm:message' => 'document type does not allow element "LINK" here' }, { 'm:line' => '14', 'm:col' => '41', 'm:message' => 'document type does not allow element "LINK" here' }, { 'm:line' => '21', 'm:col' => '4', 'm:message' => 'document type does not allow element "META" here' } ];