3531 SAVECOPFILE_FREE(&PL_compiling); 3532 CopFILE_set(&PL_compiling, tryrsfp ? tryname : name); 3533 SvREFCNT_dec(namesv); 3534 if (!tryrsfp) { 3535 if (PL_op->op_type == OP_REQUIRE) { 3536 const char *msgstr = name; 3537 if(errno == EMFILE) { 3538 SV * const msg 3539 = sv_2mortal(Perl_newSVpvf(aTHX_ "%s: %s", msgstr, 3540 Strerror(errno))); 3541 msgstr = SvPV_nolen_const(msg); 3542 } else { 3543 if (namesv) { /* did we lookup @INC? */ 3544 AV * const ar = GvAVn(PL_incgv); 3545 I32 i; 3546 SV * const msg = sv_2mortal(Perl_newSVpvf(aTHX_ 3547 "%s in @INC%s%s (@INC contains:", 3548 msgstr, 3549 (instr(msgstr, ".h ") 3550 ? " (change .h to .ph maybe?)" : ""), 3551 (instr(msgstr, ".ph ") 3552 ? " (did you run h2ph?)" : "") 3553 )); 3554 3555 for (i = 0; i <= AvFILL(ar); i++) { 3556 sv_catpvs(msg, " "); 3557 sv_catsv(msg, *av_fetch(ar, i, TRUE)); 3558 } 3559 sv_catpvs(msg, ")"); 3560 msgstr = SvPV_nolen_const(msg); 3561 } 3562 } 3563 DIE(aTHX_ "Can't locate %s", msgstr); 3564 }