On 8 Mar 2005 at 10:50, Matt Reishus wrote: > Hi, here is a short test case. > > > > Test.pl > > --cut--- > > use Net::OSCAR qw(:standard :loglevels); > > print "foo\n"; > > --cut- > > > > It fails with this reason: > > > > Couldn't find Net/OSCAR/XML/Protocol.xml in search path: CODE(0xab6844) > CODE(0xc6f970) . at C:/Perl/site/lib/Net/OSCAR.pm line 142 >
I am surprised to see that you didn't get some temp directories in @INC. I ran your example as: pp -o test.exe test.pl test.exe and I get this: Couldn't find Net/OSCAR/XML/Protocol.xml in search path: CODE(0xf4a4c4) c:\temp\par-astewart\cache-9b308115a04e22eb1b1c3b89c30a5c67d19db5b0/inc/lib c:\temp\par-astewart\cache-9b308115a04e22eb1b1c3b89c30a5c67d19db5b0/inc CODE(0xdbcfc0) . at Net/OSCAR.pm line 142 What options are you running pp with? Perl version / PAR version ? > > > Checking the offending line reveals > > > > Net::OSCAR::XML::load_xml(); > > > > Which does some wacky stuff: > > foreach (@INC) { > > next unless -f > "$_/Net/OSCAR/XML/Protocol.xml"; > > $xmlfile = > "$_/Net/OSCAR/XML/Protocol.xml"; > > last; > > } > > croak "Couldn't find Net/OSCAR/XML/Protocol.xml in > search path: " . join(" ", @INC) unless $xmlfile; > > > > It appears the library is keeping some non .pm files in my > lib/Net/OSCAR/XML/ directory: Protocol.dtd, Protocol.xml, and > Protocol.parsed-xml (it appears this file is not required, but used as a > cache to speed up some stuffs) > If you had seen what I see, you could make Protocol.xml show up in the temp\par-user\cache-xxxx\inc\lib directory by using: pp -o test.exe -a perl\site\lib\net\oscar\xml\Protocol.xml;lib\Net\OSCAR\XML\Protocol.xml test.pl and load_xml() will find it. Likewise for Protocol.dtd and Protocol.parsed-xml. That's a hell of a command line with three long -a options, so you could put: perl\site\lib\net\oscar\xml\Protocol.xml;lib\Net\OSCAR\XML\Protocol.xml perl\site\lib\net\oscar\xml\Protocol.dtd;lib\Net\OSCAR\XML\Protocol.dtd perl\site\lib\net\oscar\xml\Protocol.parsed-xml;lib\Net\OSCAR\XML\Protocol.parsed-xml into a file called OSCAR_XML.lst and then : pp -o test.exe -A OSCAR_XML.lst test.pl > > > Anyway, I'm positive that this is the fault of Net::OSCAR. But is there > anything I can do to make pp works with this crazy module? > This is not the only Module that uses non-.pm stuff inside the installed lib. That's one of the situations -a or -A exists for. > > > Matt > Alan Stewart