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

  "XMLin() requires either XML::SAX or XML::Parser are /PerlApp/lib/"

That message makes no sense at all - I'd expect it to read more like:

  "XMLin() requires either XML::SAX or XML::Parser at <some module file name> line <line number>"

Anyway XML::Simple would die with the "XMLin() requires either XML::SAX or XML::Parser" message if neither XML::SAX nor XML::Parser could be loaded.

Do you have shell access to the server? Are either of those modules available?

Is there something different about the environment the web server runs in that would cause it to not be able to see the parser modules?

Replies are listed 'Best First'.
Re^2: XML::Simple -> XMLin() requires either XML::SAX or XML::Parser
by Anonymous Monk on Aug 07, 2008 at 04:35 UTC

    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.

      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 ($@)";