Special_K has asked for the wisdom of the Perl Monks concerning the following question:
I have a collection of perl modules that were installed locally (/home/user_foo/perl_modules/lib/perl5) using cpanm (cpanm -L$PWD <module_name>). This particular machine is running RHEL7 and has the following 2 perl versions installed:
/tool/bin/perl (v5.12.2) /usr/bin/perl (v5.16.3)
Scripts created on this machine start with #!/tool/bin/perl and have use lib '/home/user_foo/perl_modules/lib/perl5' to access the locally-installed modules. Note /home/user_foo/perl_modules/lib/perl5 is on a network and accessible to all machines. If I try to run those scripts on a different machine running RHEL8, I receive the following error:
/tool/bin/perl: symbol lookup error: /home/user_foo/perl_modules/lib/p +erl5/x86_64-linux/auto/List/Util/Util.so: undefined symbol: Perl_gv_i +nit
This RHEL8 machine has the following versions of perl installed:
/tool/bin/perl (v5.20.0) /usr/bin/perl (v5.26.3)
Based on some searching it seems the error is related to a mismatch between the version of perl being run vs the version of perl used to originally install the modules. If I create a new local perl module installation directory on the RHEL8 machine:
/new_location/perl_modules/5.20/lib/perl5
then reinstall the modules using cpanm (cpanm -L$PWD <module_name>), I notice the following things:
1. If I change my scripts to have use lib '/new_location/perl_modules/5.20/lib/perl5' but keep the #!/tool/bin/perl, the scripts work fine.
|
|---|