Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I agree that it's really frustrating when upgrading your Perl breaks stuff.

In this case, the error message that Perl spits out when it cannot compile for this reason (missing permissions on a directory in @INC) should include a warning about the fact that it has stopped searching @INC. It does emit a message (with brevity, and still without specifically saying that the directory permissions were missing, and stating the full path of the file even if it doesn't know whether the file exists), starting in Perl 5.21.7:

$ perl5217 -I/root -Mstrict -e 1 Can't locate strict.pm: /root/strict.pm: Permission denied. BEGIN failed--compilation aborted.
There is a currently open bug discussing this, with the reporter calling for the change to be rolled back. You can also read the bug issue report that prompted the change in the first place.

Note that the directory must be executable, and the file readable. Having the directory readable if it's not executable doesn't help, on my machine at least. Using Perl 5.22:

[14:14][nick:~]$ sudo ls -la /var/noperms total 0 dr--r--r-- 3 root wheel 102 Sep 7 14:06 . drwxr-xr-x 28 root wheel 952 Sep 7 13:38 .. -r--r--r-- 1 root wheel 0 Sep 7 14:06 strict.pm [14:14][nick:~]$ perl -I/var/noperms/ -Mstrict -e 1 Can't locate strict.pm: /var/noperms/strict.pm: Permission denied. BEGIN failed--compilation aborted.
. . . the directory doesn't have to be readable at all, as long as it's executable:
[14:17][nick:~]$ sudo ls -la /var/noperms total 0 d--x--x--x 3 root wheel 102 Sep 7 14:06 . drwxr-xr-x 28 root wheel 952 Sep 7 13:38 .. -r--r--r-- 1 root wheel 0 Sep 7 14:06 strict.pm [14:17][nick:~]$ perl -I/var/noperms/ -Mstrict -e 1 strict.pm did not return a true value. BEGIN failed--compilation aborted.
And it definitely prints the full path of the file it's looking for, even if it can't read the directory, making for a very confusing error message:
[14:19][nick:~]$ sudo ls -la /var/noperms total 0 d--------- 2 root wheel 68 Sep 7 14:19 . drwxr-xr-x 28 root wheel 952 Sep 7 13:38 .. [14:19][nick:~]$ perl -I/var/noperms/ -Mstrict -e 1 Can't locate strict.pm: /var/noperms/strict.pm: Permission denied. BEGIN failed--compilation aborted.

The way forward always starts with a minimal test.

In reply to Re^2: perl lost its modules! by 1nickt
in thread perl lost its modules! by seandarcy

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, 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, 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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

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












      Results (226 votes). Check out past polls.

      Notices?