Inspired of How can I use CPAN as a non-root user? i'd like to know, how to set up cpanm for non-login users (like www)? There is no login, so i don't know how to include some dir to @INC.
Edit:
How i could set permanently enviroment var like PERL5LIB for non-login user? I can't set it from .bashrc (needs login) and not from /etc/environment (sets to everyone).
Methods of changing @INC:
On a per-script basis:
use lib ...;-Mlib=... on the shebang line.On a per-process basis:
PERL5LIB env var from the parent process.
sh: export PERL5LIB=... ; perl ...
sh: PERL5LIB=... perl ...
apache: SetEnv PERL5LIB ...
On a per-perl basis:
@INC when configuring perl when building it.use lib ...; in a script named sitecustomize.pl in the directory returned by perl -V:sitelib.[1]
Of course, you could also install your own local Perl, perhaps using perlbrew.
Notes:
sitecustomize.pl if The perl has been configured to do with -Dusesitecustomize. Check with perl -V:usesitecustomize to see if it was.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With