use XML::Simple qw(:strict); ... my $h=XMLin('your-xml-code-or-file-name-goes-here', forcearray => [ qw(person) ], keyattr => []);