Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: perl lost its modules!

by boftx (Deacon)
on Apr 01, 2014 at 23:51 UTC ( #1080657=note: print w/replies, xml ) Need Help??


in reply to perl lost its modules!

This is a long shot, but is it possible that one of the earlier dirs in @INC has permissions that prevent perl from looking in it and is causing perl to terminate the search early? That "permission denied" message might make that feasible.

Edit: Another thought, do you know for sure what effective uid/gid perl is running under? Is it possible the SUID bit is set? Like I said, these are long shots at best.

It helps to remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.

Replies are listed 'Best First'.
Re^2: perl lost its modules!
by dave_the_m (Monsignor) on Apr 02, 2014 at 00:09 UTC
    This is a long shot, but is it possible that one of the earlier dirs in @INC has permissions that prevent perl from looking in it and is causing perl to terminate the search early?
    Actually that is almost certainly the issue. The OP has /root first in the path which normally isn't accessible, and perl 5.18.0 onwards stops and errs on failure:
    $ perl5180 -I/root -Mstrict -e 1 Can't locate strict.pm: Permission denied. BEGIN failed--compilation aborted. $

    Dave.

      OK, you're my new favorite solution. How do I change the INC path? Or do I create the /root/perl5 folders, and chmod 755?

        How do I change the INC path? Or do I create the /root/perl5 folders, and chmod 755
        You mention earlier that "The Fedora installation does set PERL5LIB to /root/perl5", to which I would reply, no it doesn't, not by default. what I suspect you are doing is being logged in as root, and in root's /root/.bashrc or similar, it sets PERL5LIB to $HOME/perl5. Then you are doing su user rather than su - user, and so inheriting root's environment. Note that /root is the root user's home directory; a non-root user should *not* be accessing anything under /root.

        So in summary, your PERL5LIB environment variable shouldn't be set; find out how its being set, and stop it.

        Dave.

        How was Perl installed? Was it an RPM or build-from-scratch? It seems strange that an RPM would put anything under /root in @INC. Changing dir perms is usually a Bad Idea (tm) so I would consider completely uninstalling Perl and starting over if possible.

        It helps to remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.

        Check:

        echo $PERL5LIB

        That's a shell, not a perl, command.

        Someone possibly set this previously somewhere such as /etc/profile. If that is the problem, until you can figure where it is set — grep -R PERL5LIB /etc will help with that — just

        export PERL5LIB=

        I.e., nothing after the equals sign. You could also add that to ~/.bashrc.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1080657]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2019-09-18 02:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The room is dark, and your next move is ...












    Results (220 votes). Check out past polls.

    Notices?