On redhat, different users = different @INC

Discussion in 'Perl Misc' started by Russ, Aug 20, 2007.

  1. Russ

    Russ Guest

    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
     
    Russ, Aug 20, 2007
    #1
    1. Advertising

  2. Russ

    Paul Lalli Guest

    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
     
    Paul Lalli, Aug 20, 2007
    #2
    1. Advertising

  3. Russ

    J. Gleixner Guest

    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
     
    J. Gleixner, Aug 20, 2007
    #3
  4. Russ

    brian d foy Guest

    In article <>, 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
     
    brian d foy, Aug 21, 2007
    #4
  5. Russ

    Russ Guest

    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
     
    Russ, Aug 21, 2007
    #5
  6. 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
     
    Martijn Lievaart, Aug 22, 2007
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sara rafiee
    Replies:
    3
    Views:
    1,068
    Scott Allen
    Oct 4, 2004
  2. Nita Raju
    Replies:
    1
    Views:
    295
    Chris Hyde
    Dec 15, 2004
  3. Replies:
    9
    Views:
    628
    =?Utf-8?B?RWx0b24gVw==?=
    Mar 8, 2006
  4. U. George
    Replies:
    4
    Views:
    845
    U. George
    Aug 11, 2005
  5. Replies:
    3
    Views:
    1,648
Loading...

Share This Page