perlcpanmultiplatformpar

Why can't Perl's PAR find the loadable object for Socket.pm?


I was using PAR::Packer to package my Perl application on Cygwin and then running it on HPUX.

A simple hello world works well, e.g.:

pp -p hello.pl

That results in a.par and then on HPUX:

parl a.par

It works great.

However when package a bigger application with many dependencies with -B bundle switch, no such luck, instead I get the error:

 Can't locate loadable object for module Socket in @INC

Any ideas, maybe some problem with Windows/unix networking? Any fixes?


Solution

  • Perl blixtor's advice from comments I am moving the "edit updates" I had in the question to answer my own question here:

    Most of the credit here goes to Andrew Barnett, the 2 key issues were the

    1. native C code library
    2. the perl LIB paths

    Here were the steps I followed to get the cygwin created par to run on HPUX, I believe steps should be about same on any unix:

    Followed Andrew's advice and removed IO::Socket with the pp -X IO::Socket switch, but then running the resulting parl on unix I get slightly modified but still related error:

    Can't locate Socket.pm in @INC (@INC contains: CODE(0x406ab018) CODE(0x4055c880) CODE(0x40563978)) at Net/Config.pm line 11
    

    even though running "perl -MCPAN -e shell" on the unix showed Socket should be installed and up to date:

    cpan[2]> install IO::Socket
    IO::Socket is up to date (1.30_01).
    

    So in addition to excluding Socket with the -X switch abobe, I also had to create a wrapper script on HPUX with just this 1 line in in, wrapper.pl:

    use PAR { file => 'bdiff.par', run => 'bdiff.pl' };
    

    then to run this I didn't use parl, instead I would just call it with perl and I had to supply the entire paths to the default lib paths with the -I switch, like this:

    perl -I/lib/perl5/lib/5.10.0/PA-RISC2.0 -I/lib/lib/site_perl wrapper.pl allparameters
    

    for some reason when using parl it seems the default lib paths get excluded, hence the full paths above.