in reply to Re^4: Can't locate IO/Scalar.pm in @INC (@INC contains: /opt/rocks/lib/perl5/5.8.8/
in thread Can't locate IO/Scalar.pm in @INC (@INC contains: /opt/rocks/lib/perl5/5.8.8/

No way. There should be at least "()()" added. If not, you didn't execute the requested code. (Mind you, I'm not convinced of the usefulness of the test.)

By the way, I'm confused as to how /opt/rocks/lib/perl5/5.8.8/ became /usr/lib/perl5/5.8.8 halfway through the thread.

Replies are listed 'Best First'.
Re^6: Can't locate IO/Scalar.pm in @INC (@INC contains: /opt/rocks/lib/perl5/5.8.8/
by Anonymous Monk on Apr 25, 2009 at 13:52 UTC
    I think its useful, this is what I get:
    C:\Temp>echo package FooTempTest;warn __PACKAGE__; 1; > FooTempTest.pm C:\Temp>perl -MFooTempTest -e 1 FooTempTest at FooTempTest.pm line 1. C:\Temp>cacls.EXE FooTempTest.pm /E /D %username% processed file: C:\Temp\FooTempTest.pm C:\Temp>more FooTempTest.pm Cannot access file C:\Temp\FooTempTest.pm C:\Temp>perl -e" eval {require FooTempTest; 1} or die qq{($@)($!)($^E) +}" (Can't locate FooTempTest.pm in @INC (@INC contains: C:/Perl/site/lib +C:/Perl/lib .) at -e l ine 1. )(Permission denied)(Access is denied) at -e line 1.

      Unfortunately, there's no guarantee the error code is related to the problem. That would be fine if that was our only tool, but previously suggested strace provides the same data more accurately.

        Are you sure? Looking at the source of the message, I think you can
        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(aTH +X_ 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 }
        strace is fine, but since it already gives an error message, maybe it should also include Strerror(errno))?