Search code examples
perlperl-data-structures

XML::Simple is it possible to eliminate tag description?


I'm trying to parse an xml file using XML::Simple library. In a designed way a line like:

<opt one="1">Text</opt>

well be parsed to

{ 'one' => 1, 'content' => 'Text' }

is it possible to get

'opt' => 'Text'

instead?


Solution

  • Try the NoAttr option in XMLin(): XML::Simple