|Perl: the Markov chain saw|
Problems running a packaged script.by vitoco (Friar)
|on Feb 06, 2019 at 12:51 UTC||Need Help??|
vitoco has asked for the wisdom of the Perl Monks concerning the following question:
Hi! I'm having this problem again, and I cannot solve it this time...
Some years ago I wrote a script to extract some info from some objects at Salesforce.com using WWW::Salesforce module, and then PAR::Packer (pp) to build a standalone EXE to be run as a scheduled task in a Windows server. It was running OK until a week ago... logs said that it couldn't log in, but that only meant that some old APIs at Salesforce where removed, and I had to update something. Changes in the configuration trying to find a proper API only changed the error message. The original EXE was generated with pp in ActivePerl in a 32-bit machine, but a year ago I changed to Strawberry in x64, so my development PC is up to date and the plain perl script runs OK on it. So it's time to rebuild the EXE!!!
As the server where the script runs daily was also a x64 machine like my PC, I thought that an EXE build here would work OK, but it failed with the following message:
That was simple to solve. I just added -l libexpat-1__.dll to the pp command line, but the error turned into:500 Can't locate object method "new" via package "LWP::Protocol::https::Socket" at WWW/Salesforce.pm line 103.
Googling around I found that setting environment variable PAR_VERBATIM could solve the missing "new" problem with other modules, but it didn't in my case, and I only got an EXE about 10% bigger than before.
I also tried to build a 32-bit EXE using a virtual machine, but the problem remained as it also had the same Strawberry perl version and the modules were up to date.
As I found that the EXE fails only on the server, where there perl is NOT installed (and it won't be), and it runs OK on machines with perl installed, I guess that something is not being included by pp in the EXE, but I cannot identify what... "-x" option of pp didn't help... the following messages are still present during the build:
At some point of my tests, I unsuccessfuly added many other communications libraries to pp command: -l libexpat-1__.dll -l libcrypto-1_1-x64__.dll -l zlib1__.dll -l libssl-1_1-x64__.dll
Now I'm clueless... Any Idea?