On Jan 5, 2008 10:58 PM, Alan Campbell <[EMAIL PROTECTED]> wrote: > [~] # ./get_rom_symbols /home/user/temp/app.xml -s=.bios > Can't locate object method "new" via package "XML::LibXML::SAX" at > XML/SAX/ParserFactory.pm line 43. > > Both the working & failing scripts import the same modules (notably > XML::Simple via use XML::Simple 2.12 qw(:strict); ). > > My colleague got everything working...but needed to rebuild perl from scratch > in order to do so - naturally we want to avoid that so we can build on any > machine.
My guess is that the different machines have different Perl SAX parser modules installed (or there precedences are different). This has been the cause of similar errors, search the list archives. Here's what's happening: - XML::Simple uses a SAX based XML parser, it asks XML::SAX for one (that will call the XML/SAX/ParserFactory.pm in your error message) - XML::SAX returns a parser based on the installed SAX perl modules; look for the file XML/SAX/ParserDetails.ini (should be in the perl module search path), it lists the installed SAX modules - XML::SAX returns the _last_ module listed in this file (which is usually the most recently installed SAX module, unless you edited this file yourself); looks like XML::LibXML::SAX was the module used above - PAR (or rather Module::ScanDeps) will pack in ParserDetails.ini, but isn't smart enough to interpret its contents and pack the appropriate module, too. If my analysis is correct, I'll suggest the following approach: - standardize on the SAX parser to use; cf. http://search.cpan.org/~grantm/XML-Simple-2.18/lib/XML/Simple.pm#ENVIRONMENT on how to force XML::Simple to use a certain SAX parser - let PAR know about this SAX parser module, either via a redundant "use" in the Perl source or by an explicit -M option to pp. Cheers, Roderich
