Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 344
Ville M Avatar asked Jan 24 '23 19:01

Ville M


1 Answers

You're hitting this because Socket loads a shared library, and that's not portable across platforms (that is, the Socket shared lib on Windows won't work on Linux won't work on HPUX).

You could try two things:

  1. Identify all the places you need shared libs, and have a native install of them on your target platform. You may also need to exclude those modules from your PAR archive.
  2. Switch to pure-Perl implementations (which are (more) portable). If you're not a whiz at Perl, C, and your target platform, and a pure-Perl version is not already available, you may be out of luck with this.
like image 71
Andrew Barnett Avatar answered Jan 31 '23 12:01

Andrew Barnett