Garden Dwarf has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I'm a new user of SOAP::Lite (v1.26) and I want to make an executable tool (I need an executable because the persons who will use it do not have Perl environment installed). When I execute the Perl code (i.e. not packaged), it executes flawlessly (connection is ok, calls are ok, etc.) but if I compile it using pp, the executable return errors.

Example of message: Use of uninitialized value $value in pattern match (m//) at SOAP/Lite.pm line 1505.

I don't know if code is usefull but here is a piece of it (the message I mentioned shows between print "Test1" and "Test2").

$soap=SOAP::Lite->new(proxy=>$soapurl); $soap->on_fault(\&soapGetBad); $soap->on_action(sub{qq("$_[0]")}); $soap->autotype(0)->readable(1); $soap->default_ns('urn:http://www.something.com/somewhere'); # Open session $som=$soap->call('OpenSession', SOAP::Data->name('parameter1')->value('12'), SOAP::Data->name('parameter2')->value('10')); if(defined($som->result)){ $sessionID=$som->result; # Open project print "Test1\n"; $som=$soap->call('OpenProject', SOAP::Data->name('sessionid')->value($sessionID), SOAP::Data->name('projectname')->value($project)) +; print "Test2\n"; ...

The first messages are warnings, as the execution does not die. But later on SOAP issues an error and stops the program execution. I believe it's due to the first warnings.

The application is packaged under Strawberry running Perl 5.14.4.1-64bit.

If you have any idea how I can fix this, it will be much appreciated. Thanks in advance for your help!

Replies are listed 'Best First'.
Re: SOAP::Lite and pp (Perl Packager) issue
by dasgar (Priest) on Jan 31, 2018 at 21:33 UTC

    Can you share the syntax that you used for the pp utility?

    The reason for asking is sometimes the pp utility doesn't properly detect and include needed modules. I've gotten in the habit using the -c and -x options when using pp, which causes it to "determine additional run-time dependencies".

    The first messages are warnings, as the execution does not die. But later on SOAP issues an error and stops the program execution. I believe it's due to the first warnings.

    If you can share those error messages, that might help others to be able to provide better assistance.

    Since I don't have any experience with SOAP in general (much less SOAP modules), I probably can't offer any further suggestions.

    I haven't tried it yet, but salva has a fairly new module called Win32::Packer that you could try instead of pp.

      I used -c and -x, and I've been able to solve my issue! "XML:Parser::Lite" was missing and now my exe executes correctly!

      My syntax is "pp -i application.ico -o application.exe application.pl" (yes, I use an older version of PP in order to change default icon). Note that I use also END{perl_code} to encapsulate my Perl program when using PP. I've read somewhere around here that this is better.

      I will check for salva/Win32::Packer to see if I'm more comfortable with it (even if pp was doing right until now). Thanks for the suggestion.

      So... even if I read your messages since a while here, this was my first post. And issue is fixed faster than I thought. Thanks again!

Re: SOAP::Lite and pp (Perl Packager) issue
by Marshall (Canon) on Jan 31, 2018 at 22:03 UTC
    Do you have a use SOAP::Lite; statement in the code?

    Update: The -x option on pp is a good idea. However, I think it even better if a simple source code modification solves the problem. Both pp and Active State's Perlapp look at the "use" statements in deciding what to include in the .exe. It is completely possible for an app to run on your Perl installation and yet the .exe fails.

      Totally right, and as posted above this was the case.

      Thanks for your help!