die as soon as it finds one. It should for instance be possible to
for require "File" to read the file "./File" even if there happens to
be a "File" directory in perl's standard library.
This fixes the RT #24404 fix in change 26373.
p4raw-id: //depot/perl@27515
{
Stat_t st;
const int st_rc = PerlLIO_stat(name, &st);
- if (st_rc < 0) {
+ if (st_rc < 0 || S_ISDIR(st.st_mode) || S_ISBLK(st.st_mode)) {
return NULL;
}
- if(S_ISDIR(st.st_mode) || S_ISBLK(st.st_mode)) {
- Perl_die(aTHX_ "%s %s not allowed in require",
- S_ISDIR(st.st_mode) ? "Directory" : "Block device", name);
- }
return PerlIO_open(name, mode);
}
my $r = "threads";
eval { require $r };
$i++;
-if($@ =~ /Directory .*threads not allowed in require/) {
+if($@ =~ /Can't locate threads in \@INC/) {
print "ok $i\n";
} else {
print "not ok $i\n";