in reply to A Confession

So, Finally, the question for the Monks is "How was I supposed to fix this problem? Or alternatively, should the location of those *.so files have been in @INC all along?"

It all depends on Configure/Config

Here are hints

Re^7: Why does PERL5LIB need to be so verbose? (installstyle sitelib installlib vendorlib INST_ARCH INST_VER userelocatableinc @INC)

Re^2: How do I tell CPAN to use a local lib? (perllib/perl5lib/perl5opt/-Idirectory/-Mblib/sitecustomize.pl )

Re: Why does PERL5LIB need to be so verbose? ( INSTALL_BASE the local::lib way)

Re: cpanm --sudo installs to /root/perl5 instead of /usr

Replies are listed 'Best First'.
Re^2: A Confession
by clerew (Novice) on Jul 16, 2015 at 11:36 UTC

    Yes, I really ought to set a PERL5LIB Environment Variable, but that is a messy option since every user using my script would have to set PERL5LIB. Well there aren't many users on my machine, but since these scripts are run as cron jobs, root would have to have PERL5LIB set too.

    The REAL problem is that @INC is hard-coded into the Perl binary, and Ubuntu/Debian have decided to set it to

    /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .

    So clearly they expect you to use /usr/local/lib/perl/5.18.2 or /usr/local/share/perl/5.18.2 for your personal libraries, but if your private library includes any C-coded stuff it does not work. Seems like a Ubuntu/Debian Bug to me, and I am minded to report it as such.