in reply to How to use XML::Parser
use strict; use warnings; use Data::Dumper qw( Dumper ); use XML::Simple qw( :strict ); my $xml = do { local $/; <DATA> }; my $tree = do { local $XML::Simple::PREFERRED_PARSER = 'XML::Parser'; XMLin($xml, ForceArray => [], KeyAttr => {}, ) }; print(Dumper($tree)); __DATA__ <root> <tag1>My Tag1</tag1> <tag2>My Tag2</tag2> <tag3>My Tag3</tag3> </root>
|
|---|