in a function/method name or a failure to C<AutoSplit> the file, say, by
doing C<make install>.
-=item Can't locate %s in @INC
-
-(F) You said to do (or require, or use) a file that couldn't be found
-in any of the libraries mentioned in @INC. Perhaps you need to set the
-PERL5LIB or PERL5OPT environment variable to say where the extra library
-is, or maybe the script needs to add the library name to @INC. Or maybe
-you just misspelled the name of the file. See L<perlfunc/require>.
+=item Can't locate %s
+
+(F) You said to C<do> (or C<require>, or C<use>) a file that couldn't be
+found. Perl looks for the file in all the locations mentioned in @INC,
+unless the file name included the full path to the file. Perhaps you need
+to set the PERL5LIB or PERL5OPT environment variable to say where the extra
+library is, or maybe the script needs to add the library name to @INC. Or
+maybe you just misspelled the name of the file. See L<perlfunc/require>
+and L<lib>.
=item Can't locate object method "%s" via package "%s"
SvREFCNT_dec(namesv);
if (!tryrsfp) {
if (PL_op->op_type == OP_REQUIRE) {
- SV *msg = sv_2mortal(newSVpvf("Can't locate %s in @INC", name));
- SV *dirmsgsv = NEWSV(0, 0);
- AV *ar = GvAVn(PL_incgv);
- I32 i;
- if (instr(SvPVX(msg), ".h "))
- sv_catpv(msg, " (change .h to .ph maybe?)");
- if (instr(SvPVX(msg), ".ph "))
- sv_catpv(msg, " (did you run h2ph?)");
- sv_catpv(msg, " (@INC contains:");
- for (i = 0; i <= AvFILL(ar); i++) {
- char *dir = SvPVx(*av_fetch(ar, i, TRUE), n_a);
- sv_setpvf(dirmsgsv, " %s", dir);
- sv_catsv(msg, dirmsgsv);
+ char *msgstr = name;
+ if (namesv) { /* did we lookup @INC? */
+ SV *msg = sv_2mortal(newSVpv(msgstr,0));
+ SV *dirmsgsv = NEWSV(0, 0);
+ AV *ar = GvAVn(PL_incgv);
+ I32 i;
+ sv_catpvn(msg, " in @INC", 8);
+ if (instr(SvPVX(msg), ".h "))
+ sv_catpv(msg, " (change .h to .ph maybe?)");
+ if (instr(SvPVX(msg), ".ph "))
+ sv_catpv(msg, " (did you run h2ph?)");
+ sv_catpv(msg, " (@INC contains:");
+ for (i = 0; i <= AvFILL(ar); i++) {
+ char *dir = SvPVx(*av_fetch(ar, i, TRUE), n_a);
+ sv_setpvf(dirmsgsv, " %s", dir);
+ sv_catsv(msg, dirmsgsv);
+ }
+ sv_catpvn(msg, ")", 1);
+ SvREFCNT_dec(dirmsgsv);
+ msgstr = SvPV_nolen(msg);
}
- sv_catpvn(msg, ")", 1);
- SvREFCNT_dec(dirmsgsv);
- DIE("%_", msg);
+ DIE("Can't locate %s", msgstr);
}
RETPUSHUNDEF;