Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Problems running a packaged script.

by Lotus1 (Vicar)
on Feb 06, 2019 at 16:21 UTC ( [id://1229481]=note: print w/replies, xml ) Need Help??


in reply to Problems running a packaged script.

Try including those two modules in your exe by using the -M option: e.g. -M Module::Runtime.

Unfortunately PAR::Packer has a hard time with modules that are loaded dynamically. I've had good luck with using one command prompt with the portable version of Strawberry Perl running it's shell and another without. I run pp in the Strawberry shell and then test the exe in the non Strawberry shell. It sounds like you have installed Strawberry Perl so that won't work. But you might be able to find a way to run a command prompt and override the path so it can't find the Perl folders.

Update: The Perlmonks module review for PAR mentions using -M and the POD for pp explains the details, including using '*' to include multiple modules from a namespace.

Update 2: I'm getting the same error you posted: 500 Can't locate object method "new" via package "LWP::Protocol::https::Socket" at WWW/Salesforce.pm line 103. I created a simple two line program that just tries to log in with a fake test account.

use strict; use warnings; use WWW::Salesforce; eval { WWW::Salesforce->login( 'username' => 'test','password' => '123 +4' ); }; print "> $@ <\n" if $@;

The interesting thing is that there is no such thing as Socket.pm at "LWP::Protocol::https::Socket". I attempted to install that module when I noticed it was not on my system. When I run the script or the exe in the environment with Perl it works fine. I open a second command prompt and type set path=c:\temp. Then when I run the exe I get the error along with some popups about dlls I haven't linked yet.

I also found a Perlmonks node related to this error.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1229481]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-04-16 16:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found