Bod has asked for the wisdom of the Perl Monks concerning the following question:
I have some common modules that are used in several places so I have created a directory for them at /usr/lib/perl_modules. I want to include this location in @INC for every user, including CRON.
I've added export PERL5LIB=/usr/lib/perl_modules in both /etc/environment and /etc/profile.
When I list the environment variables, PERL5LIB is there as expected. But when I try to use on of the modules I get an error:
There are other locations in @INC but /usr/lib/perl_modules is not one of them...Can't locate my_module.pm in @INC (you may need to install the my_modu +le module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/ +perl/5.36.0 /usr/local/share/perl/5.36.0)
I suspect the environment variable is set for root that I'm using to list the variables, but not for whatever process is running the script within Apache.
How can I properly set PERL5LIB for all users and processes or is there a better way to get an extra entry in @INC for every script without having to use lib in every script?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: PERL5LIB not in @INC
by hippo (Archbishop) on Mar 23, 2024 at 15:11 UTC | |
|
Re: PERL5LIB not in @INC
by haj (Vicar) on Mar 23, 2024 at 15:29 UTC | |
by Bod (Parson) on Mar 23, 2024 at 16:14 UTC | |
|
Re: PERL5LIB not in @INC
by Anonymous Monk on Mar 23, 2024 at 15:59 UTC |