zdavek has asked for the wisdom of the Perl Monks concerning the following question:

We upgraded from perl 5.14.2 to perl 5.20.2 and updated most of our modules this last weekend. Our programming staff have no problems running anything but our end users are all getting messages like:

Can't locate MIME/Lite.pm:   Permission denied at /path_to_script/msg_send.pl line 18.
BEGIN failed--compilation aborted at /path_to_script/msg_send.pl line 18.
I'm guessing something has the wrong perms but cannot track it down. MIME::Lite is installed and the permissions are:
drwxr-sr-x  3 root common     96 May 23 12:49 lib/site_perl/
drwxr-sr-x 56 root common   8192 May 24 11:11 lib/site_perl/5.20.2/
drwxr-sr-x  2 root common   8192 May 23 13:16 lib/site_perl/5.20.2/MIME/
-r--r--r--  1 root common 105117 Nov  3  2013 lib/site_perl/5.20.2/MIME/Lite.pm
I'll note that every normal user of our system is in the common group. Also end users have no problems if no modules are used.

Replies are listed 'Best First'.
Re: Permission denied to module
by Corion (Patriarch) on May 26, 2015 at 20:06 UTC

    Since 5.18, when require (and thus, I surmise, use), can't read a file, it dies (perl5180delta.pod):

    require dies for unreadable files

    When require encounters an unreadable file, it now dies. It used to ignore the file and continue searching the directories in @INC perl #113422.

    So maybe you have another directory with an unreadable MIME/Lite.pm in @INC, and that causes the failure?

      A common variant on an unreadable file is that the directory which the file may or may not be in is itself unreadable (perl doesn't distinguish between these cases). So the OP likely has PERLLIB or PERL5LIB including an unreadable directory.

      The almost-released perl-5.22.0 improves the error message by indicating which path failed:

      $ export PERLLIB=/root $ perl-5.16.0 -Mstrict -e1 $ perl-5.18.0 -Mstrict -e1 Can't locate strict.pm: Permission denied. $ perl-5.20.0 -Mstrict -e1 Can't locate strict.pm: Permission denied. $ perl5.22.0-RC2 -Mstrict -e1 Can't locate strict.pm: /root/strict.pm: Permission denied.

      Dave.

        Yes! That was it! We had PERL5LIB defined in our shell initialization scripts with a directory that was not accessible to most of our users. Thanks.
Re: Permission denied to module
by GotToBTru (Prior) on May 26, 2015 at 20:00 UTC

    I trust that those directory and file permissions are the same as for the corresponding 5.14.2 installation?

    Look at @INC - are there other versions of Lite.pm in other directories that are not so accessible?

    Dum Spiro Spero