On redhat, different users = different @INC

On redhat, different users = different @INC

am 20.08.2007 21:00:34 von Russ

Hi,

We have RedHat 4EL and perl 5.8.5. Per a user's request I installed
Date:Simple, using perl -MCPAN -e shell
as the root user.
Now root can find Date::Simple, but other users cannot. They do not
want to include a lib statement in their scripts or invoke with a -I.
The @INC libraries are close, but not identical.

Does anyone know how to correct or resolve this?
Any suggestions would be appreciated.

Best regards,
Russ

Re: On redhat, different users = different @INC

am 20.08.2007 21:07:52 von Paul Lalli

On Aug 20, 3:00 pm, Russ wrote:

> We have RedHat 4EL and perl 5.8.5. Per a user's request I
> installed Date:Simple, using perl -MCPAN -e shell
> as the root user.
> Now root can find Date::Simple, but other users cannot. They
> do not want to include a lib statement in their scripts or
> invoke with a -I. The @INC libraries are close, but not
> identical.
>
> Does anyone know how to correct or resolve this?
> Any suggestions would be appreciated.

In their .profile (or .bash_profile, or whatever), set the PER5LIB
variable to the path of the installed modules.

export PERL5LIB=/path/to/modules/
or
setenv PERL5LIB /path/to/modules
(depending on the shell in use...)

Paul Lalli

Re: On redhat, different users = different @INC

am 20.08.2007 22:45:11 von glex_no-spam

Paul Lalli wrote:
> On Aug 20, 3:00 pm, Russ wrote:
>
>> We have RedHat 4EL and perl 5.8.5. Per a user's request I
>> installed Date:Simple, using perl -MCPAN -e shell
>> as the root user.
>> Now root can find Date::Simple, but other users cannot. They
>> do not want to include a lib statement in their scripts or
>> invoke with a -I. The @INC libraries are close, but not
>> identical.
>>
>> Does anyone know how to correct or resolve this?
>> Any suggestions would be appreciated.
>
> In their .profile (or .bash_profile, or whatever), set the PER5LIB
> variable to the path of the installed modules.
>
> export PERL5LIB=/path/to/modules/
> or
> setenv PERL5LIB /path/to/modules
> (depending on the shell in use...)

Also, are they using the same 'perl' as root is using?

root# which perl

someuser% which perl

Re: On redhat, different users = different @INC

am 21.08.2007 01:54:26 von brian d foy

In article <1187636434.682093.27920@19g2000hsx.googlegroups.com>, Russ
wrote:

> We have RedHat 4EL and perl 5.8.5. Per a user's request I installed
> Date:Simple, using perl -MCPAN -e shell
> as the root user.
> Now root can find Date::Simple, but other users cannot. They do not
> want to include a lib statement in their scripts or invoke with a -I.
> The @INC libraries are close, but not identical.

Where did you install it? Simply being a root user doesn't mean it
installed it in the common Perl directories. The CPAN.pm config can set
options for Makefile.PL, and so on.

Have you inspected the @INC? I'd be curious to see how it differs
between users, or if this one user had puroposedly modified his @INC to
contain the libraries he knew Date::Simple would be in.

--
Posted via a free Usenet account from http://www.teranews.com

Re: On redhat, different users = different @INC

am 21.08.2007 23:46:11 von Russ

On Aug 20, 3:00 pm, Russ wrote:
> Hi,
>
> We have RedHat 4EL and perl 5.8.5. Per a user's request I installed
> Date:Simple, using perl -MCPAN -e shell
> as the root user.
> Now root can find Date::Simple, but other users cannot. They do not
> want to include a lib statement in their scripts or invoke with a -I.
> The @INC libraries are close, but not identical.
>
> Does anyone know how to correct or resolve this?
> Any suggestions would be appreciated.
>
> Best regards,
> Russ

Thank you all for your responses. What I've found so far is
1. I searched all files in the user's directory, find . -type f -exec
grep -il PERL5LIB {} \;
Nothing. There is a .cpan directory.
2. I tested several users, including root and all resolve to the same
perl - /usr/bin/perl
3. I think CPAN.pm may be the issue. It is being installed in
directories under /root. The bulk of the other modules appear to be
under /usr/lib/perl5/5.8.5. That includes a copy of CPAN.pm.
Having never alter CPAN.pm I'm not certain what I'm looking for.
Please excuse my ignorance.

Do I hard code a value for a parameter (build_dir?) or is there a
command line override saying build it over there?

Thanks,
Russ

Re: On redhat, different users = different @INC

am 22.08.2007 22:03:22 von Martijn Lievaart

On Mon, 20 Aug 2007 12:00:34 -0700, Russ wrote:

> Hi,
>
> We have RedHat 4EL and perl 5.8.5. Per a user's request I installed
> Date:Simple, using perl -MCPAN -e shell as the root user.

Next time, do a 'yum install perl-Date-Simple'.

HTH,
M4