in reply to Re: PERL5LIB on CentOS
in thread PERL5LIB on CentOS

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

Replies are listed 'Best First'.
Re^3: PERL5LIB on CentOS
by hippo (Archbishop) on Jun 27, 2014 at 13:17 UTC

    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.

        A quick centos profile.d not sourced gives me two posts that explain what happens and how you can fix things.

        Maybe you want to use an anonymous Google window so Google shows you the solutions instead of misleading you?