Random Perl Problems

Problems with XML::Simple

I had a problem when trying to load XML::Simple through cpan. Here was the message I got:

=============================================================================

  Fatal error: Your default XML parser (XML::SAX::PurePerl) is broken.

  There are known bugs in the PurePerl parser included with version 0.13
  and 0.14 of XML::SAX.  The XML::Simple tests will fail with this parser.

  One way to avoid the problem is to install XML::SAX::Expat - it will
  install itself as the system default XML parser and then you will be able
  to install XML::Simple successfully.  XML::SAX::Expat is also much faster
  than XML::SAX::PurePerl so you probably want it anyway.

=============================================================================

My solution was to do the following:

  1. Install XML::SAX::Expat using cpan (sudo cpan -i XML::SAX::Expat)
  2. Find and open ParserDetails.ini. It should contain something like the following:
    [XML::SAX::PurePerl]
    http://xml.org/sax/features/namespaces = 1
  3. Change the contents of ParserDetails.ini to read the following (This should set XML::SAX::Expat to be the default parser.):
    [XML::SAX::Expat]
    http://xml.org/sax/features/namespaces = 1
    http://xml.org/sax/features/validation = 1
    http://xml.org/sax/features/external-general-entities = 1
    http://xml.org/sax/features/external-parameter-entities = 1
  4. Now try to install XML::Simple again. It should work correctly.
public/perl.txt · Last modified: 2008/08/09 09:59 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki