| [reply] |
I am getting tired by being pointed to this comment each and every time. For such simple stuff the module is still useful.
And anyways, the OP will reply that (s)he does not want to install any module, see earlier questions... Re^4: XML file difference highlights
| [reply] |
For such simple stuff the module is still useful.
I agree that the module can still be used for very simple cases, like reading simple config files in a known format (Update: although there are better modules available, such as XML::Rules). However, we don't know if the OP's actual XML really is as simple as the example shown in the root node, therefore whether it will work at all (see code below), and you also didn't mention any of the major caveats associated with that module, which is why I posted my comment.
use warnings;
use strict;
use Data::Dump;
use XML::Simple qw/:strict XMLin/;
dd XMLin('<root><x><y>Foo</y></x></root>',ForceArray=>[],KeyAttr=>[]);
dd XMLin('<root><x y="Foo"></x></root>', ForceArray=>[],KeyAttr=>[]);
__END__
{ x => { y => "Foo" } }
{ x => { y => "Foo" } }
| [reply] [d/l] |
| [reply] |