develooper Front page | perl.perl5.porters | Postings from September 2014

[perl #113422] make require stop at the first found/failed file

Thread Previous
From:
Luciano Rocha via RT
Date:
September 19, 2014 12:11
Subject:
[perl #113422] make require stop at the first found/failed file
Message ID:
rt-4.0.18-26753-1411117599-1499.113422-14-0@perl.org
We were bitten by this fix.

The description didn't help finding the reason of the error:
-sh-4.1$ /usr/local/booking-perl/5.18.2/bin/perl5.18.2 -e 'print "@INC\n"'
/usr/local/git_tree/main/lib /usr/local/booking-perl/5.18.2/site/lib /usr/local/booking-perl/5.18.2/lib .

-sh-4.1$ /usr/local/booking-perl/5.18.2/bin/perl5.18.2 -e 'use warnings; print "@INC\n"'
Can't locate warnings.pm:   Permission denied at -e line 1.
BEGIN failed--compilation aborted at -e line 1.

-sh-4.1$ ls -l /usr/local/booking-perl/5.18.2/lib/warnings.pm 
-r--r--r-- 1 root root 20624 Jan 28  2014 /usr/local/booking-perl/5.18.2/lib/warnings.pm

The problem was having a directory in PERL5LIB that had the wrong permissions.

Test case:
$ PERL5LIB=/root /usr/local/booking-perl/5.18.2/bin/perl5.18.2 -e 'use warnings; print "@INC\n"'
Can't locate warnings.pm:   Permission denied at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
$ PERL5LIB=/root /usr/local/booking-perl/5.14.2/bin/perl5.14.2 -e 'use warnings; print "@INC\n"'
/root /usr/local/booking-perl/5.14.2/site/lib /usr/local/booking-perl/5.14.2/lib .

So perl isn't distinguishing from "no permission to read file" and "no permission to access a component in @INC".

Could the fix be changed to only report on file permissions, or make the error more informative (include the path that gave the error, not just the module name)?

Regards.

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About