1

When using XML::Simple, I always get the warning

could not find ParserDetails.ini in /usr/lib/perl5/vendor_perl/5.8.8/XML/SAX

I would like do do something like

{
no warning qw(insert_your_magic_here);
my $hash_ref = XMLin('my_file.xml')
}

I red perldoc about warning http://perldoc.perl.org/warnings.html and found a 'Cathegory hiearchy' but I do not know in which category is this warning.

Do you know it?

May you know what are those ParserDetail intented for?

MUY Belgium
  • 2,330
  • 4
  • 30
  • 46

1 Answers1

5

Despite its name, XML::Simple is extremely difficult to get working correctly, and you would be much better off using XML::Twig or XML::LibXML instead.

XML::Simple is warning you that there is no useable SAX parser configuration. Since XML::Parser is faster and more reliable than the SAX options, I suggest you tell XML::Simple to use it instead. You can do this by adding

$XML::Simple::PREFERRED_PARSER = 'XML::Parser';

to the top of your program, right after use XML::Simple.

You may also have to install XML::Parser, as it isn't one of the pre-installed core modules.

Borodin
  • 126,100
  • 9
  • 70
  • 144