in reply to PERL5LIB on CentOS

For example cronjobs do not load the .profile for the user.

Maybe you want to tell us more details about which scripts work and which don't, and what the difference between them is?

Replies are listed 'Best First'.
Re^2: PERL5LIB on CentOS
by qhen (Acolyte) on Jun 27, 2014 at 13:02 UTC

    ok, thanks - looks like the only way to do this with cron is explicitly:

    */5 * * * * export PERL5LIB=/abc /xxx/script.pl

    That solves that problem.

    However, NO scripts for any users use PERL5LIB from /etc/profile.d/xxxx.sh

      Simple diagnosis. Login as the user in question then try this:

      $ echo $PERL5LIB /foo/bar/lib $ perl -e 'print $ENV{PERL5LIB} . "\n";' /foo/bar/lib

      which will show whether it is in the environment to begin with and if so whether you are doing something in your perl setup to negate that.

        um, thanks. Does not answer the question.

        I suppose this comes back to my confession that the question is really not perl related, but I was hoping someone else had faced+resolved this before.

        UPDATE: Let me elaborate to satisfy those with trigger-happy downvote fingers: I've already done the diagnosing, and yes, the environment variable is not being set when users login. I was hoping someone had encountered this before on CentOS/Linux and knew how to correctly set an env variable which all users got when they logged in. The fact that it's PERL5LIB is actually incidental.