Home > Mobile >  What is corect way to configure path to packages for perl?
What is corect way to configure path to packages for perl?

Time:06-20

I may configure location of packages for perl via PERL5LIB, -Ipath/to/libs option, use lib LIST. But what if I add paths into @INC manually: BEGIN{ unshift @INC, './local' }

Why perl do not add add site_perl/5.30.3/x86_64-linux and 5.30.3/x86_64-linux automatically?

CodePudding user response:

You tell Perl to add one string to an array, so Perl adds one string to the array. If you want to add other strings too, you will need to add those other strings too.

Or use one of the three methods you listed that does what you want.

Besides, ./local isn't the right path. It means local in the current work directory. It doesn't mean local in the same directory the script is located. For that, you want

use RealBin qw( $RealBin );
use lib "$RealBin/local";
  •  Tags:  
  • perl
  • Related