I was using perl5 and executing my script
perl myscript.R
and was getting following error.
Can't locate local/lib.pm in @INC (you may need to install the local::lib module) (@INC contains: /kb/deployment/lib /kb/deployment/lib/perl5 /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base).
BEGIN failed--compilation aborted.
so i installed local::lib using following command
cpan local::lib
but after i tried to use the perl myscript.pl and getting
XS.c: loadable library and perl binaries are mismatched (got handshake key 0xce00080, needed 0xdb80080)
I am clueless about fixing thsi issue.
The version of the binary component and the version of the Perl component of the module you are trying to load don't match.
You appear to have used local::lib to install modules in your home dir. Upgrading your perl causes this setup to fail badly. The solution is to delete ~/perl5[1] and reinstall the modules you had locally installed.
What if you have more than one build of Perl or you don't want to have this problem the next time you upgrade Perl?
There are ways of telling the installers to install modules in your home dir in such a way that multiple builds of Perl can share the installation directory,[2] but it doesn't really work.[3]
This is why I use perlbrew to install Perl itself in my home dir so I don't have to override the installation location of modules. Using perlbrew has the following benefits:
PREFIX/--prefix and LIB/--lib options to Makefile.PL/Build.PL instead of INSTALL_BASE/--install-base.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With