Yesterday, I have installed PERL 5.20.2 as root in

/usr/local/bin/perl-5.20.2

The libraries and modules have been correctly installed in

/usr/local/bin/perl-5.20.2/lib/

Directories of /usr/local/bin have to my view correct permission settings 755 and the modules have to my view correct permission settings 644.

I switched then the user to "daily_work" and tried to execute a PERL script which makes use of libraries and modules.

I obtained the error message "Permission denied" for all the libraries and modules used.

I tried then to add a line

use lib '/usr/local/bin/perl-5.20.2/lib' ;

but the interpreter remained stubborn and wrote

lib.pm "Permission denied"

In the FileBrowser all libraries and modules were "locked" but there was no job visible with "top" which could have locked PERL modules. A system restart removing potential remainings of the "make install" didn't improve anything.

After a re-installation of PERL and some necessary modules from CPAN I tried to excute the same PERL script as root and the result was 100% correct and no error message appeared. Unfortunately, this does not mean anything on my LINUX machine - root is the king and has all permissions.

I tried then to print @INC in order to find out the paths to be checked for permissions:

for ($i=0; $i<scalar(@INC); ++$i) { print $INC[$i]."\n"; } print "end of vector INC \n\n";

The output was:

/root/localperl/lib/site_perl/5.20.2/x86_64-linux

/root/localperl/lib/site_perl/5.20.2

/root/localperl/lib/5.20.2/x86_64-linux

/root/localperl/lib/5.20.2

.

end of vector INC

In former versions of PERL there had been at least an @INC entry looking like

/usr/local/bin/perl-5.20.2/lib/

Now the questions are:

a) How can I (and most likely many other PERL programmers) fix that as normal users when lib.pm is "locked" by root's home?

b) How can I install PERL in such a way that all users have access to the libraries and modules?

With kind regards

mvi


In reply to LINUX PERL 5.20.2 libraries and modules: "Permission denied" for all users except root by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.