Clear questions and runnable code
get the best and fastest answer
"symbol lookup error" message helpby Special_K (Monk)
|on Jan 20, 2023 at 20:41 UTC||Need Help??|
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:
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:
This RHEL8 machine has the following versions of perl installed:
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:
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.
2. If I change my scripts to have use lib '/new_location/perl_modules/5.20/lib/perl5' and also change #!/tool/bin/perl to #!/usr/bin/perl, the scripts still work fine even though the perl version is now different.
3. The /new_location/perl_modules/5.20/lib/perl5 has a 5.26.3/x86_64-linux-thread-multi subdirectory that is empty
What exactly is causing the original error above? I suspect it is some sort of mismatch issue between the version of perl used to install the modules vs the version being run, but that leads to the following questions:
1. How do I specify which version of perl is being used when I install a module using cpanm?
2. Why do the new modules I installed to /new_location/perl_modules/5.20/lib/perl5 work for both /tool/bin/perl (v5.20.0) and /usr/bin/perl (v5.26.3) if module installations are version-dependent? Or am I misunderstanding the real issue here?