Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: XML::Simple -> XMLin() requires either XML::SAX or XML::Parser

by Anonymous Monk
on Aug 07, 2008 at 04:35 UTC ( [id://702796] : note . print w/replies, xml ) Need Help??


in reply to Re: XML::Simple -> XMLin() requires either XML::SAX or XML::Parser
in thread XML::Simple -> XMLin() requires either XML::SAX or XML::Parser

I have shell access to the server, these modules will not be available on the server. The Perl-CGI page and .pl scripts being invoked are compiled using PerlApp.

The weird thing is that it was working and all of a sudden it has stopped. Some environment changes may have taken place, but according to ActiveState when you compile using PerlApp you compile all necessary Perl Modules into your .pl and/or cgi scripts. This has worked for me in the past and still works today. However, for some reason I believe a library XML::Simple or the XML::Parser relies on has disappear...the problem is I have no clue what linux libraries it would possibly need besides expat.

  • Comment on Re^2: XML::Simple -> XMLin() requires either XML::SAX or XML::Parser

Replies are listed 'Best First'.
Re^3: XML::Simple -> XMLin() requires either XML::SAX or XML::Parser
by grantm (Parson) on Aug 07, 2008 at 08:23 UTC

    If you have XML::SAX (which includes a PurePerl parser) then no external libraries are required for XML::Simple to work. If you want better parsing speed then by all means use XML::Parser (or XML::SAX::ExpatXS) but either of these Perl modules will need access to libexpat. No other external libraries are required.

    If I were trying to diagnose it, I'd probably use the strace tool (on Linux) to log the system calls that the application is making. The log would probably show an attempt to open a file that doesn't exist.

    The other thing you could do is rebuild your PerlApp compilation with a modified copy of XML::Simple. Find the line that generates that error and modify the error string to include $@ - the text of the error that caused the parser load to fail. E.g.:

    croak "XMLin() requires either XML::SAX or XML::Parser ($@)";