On Mon, May 31, 2010 at 11:14 AM, Developer <[email protected]> wrote:
> I wanted to use 'pp' to build an "executable" for a little XML::RPC-Server
> using module RPC::XML::Server on a linux/debian server. Unfortunately I get
...
> Can't call method "parse" on an undefined value at
> blib/lib/RPC/XML/Server.pm (autosplit into
> blib/lib/auto/RPC/XML/Server/process_request.al) line 1765.
>
> I am surprised about the appearance of _blib_ in the error message.

The blib is a red herring: any autosplit module will report errors in this way
(grep for #line statements in any *.al file).

IMHO, the real problem is in RPC::XML::ParserFactory. It's used to manufacture
the parser used by your instance instance of RPC::XML::Server.
ParserFactory is just an interface, it loads one of the RPC::XML::Factory::*
implementations which in trun will load a "real" XML parser module, e.g.
XML::LibXML or XML::Parser.

My guess is that either  RPC::XML::Factory::* or the real XML parsers
(or bothe) didn't get included in your packed executable, because
Module::Scandeps wasn't able to detect their use by static analysis.

In theory, you could try the -x option to pp that would also pack all modules
that actually have loaded by your script during execution. However, in your
case that's a bit tricky since pp will run your script once for that,
so it will
probably look hung, because your server script doesn't terminate
(unless killed). In addition, it seems that the parser factory is
invoked lazily,
i.e. only on the first client request, so you would have to run "pp -x ..." and
then start a client from another window.

It's probably easier to add RPC::XML::Parser::XMLParser explicitly
(it looks like it's the default used by RPC::XML::ParserFactory) with

pp -M RPC::XML::Parser::XMLParser ...

Cheers, Roderich

this should pick up the actual XML::Parser automatically.

Reply via email to