Eugen Konkov
Eugen Konkov

Reputation: 25133

What is corect way to configure path to packages for perl?

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?

Upvotes: 2

Views: 76

Answers (1)

ikegami
ikegami

Reputation: 385655

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";

Upvotes: 3

Related Questions