Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

@inc problem

by mark4444az (Sexton)
on May 06, 2014 at 15:18 UTC ( [id://1085195]=perlquestion: print w/replies, xml ) Need Help??

mark4444az has asked for the wisdom of the Perl Monks concerning the following question:

When I try to run a perl script I get: "Can't locate strict.pm in @INC (@INC contains: C:/Perl164/site/lib" A search for strict.pm shows that it is in C:\Perl\lib which means my @INC is wrong, maybe due to a bad install. Is there a way to change that?

Replies are listed 'Best First'.
Re: @inc problem
by Anonymous Monk on May 06, 2014 at 15:35 UTC

    The cleanest way is to re-install Perl. It should be much easier than trying to fix whatever happened here.

    Did you rename your Perl directory after in the install? That is usually not supported, except for example the Strawberry Perl PortableZIP edition.

      I did not rename the perl directory. You're right, I'm going to uninstall and start over. I did a system restore and that's when the issue started.

        The error message indicates that Perl is looking in C:/Perl164/, and you wrote that you have Perl installed in C:/Perl/, so it's likely a rename happened a some point in time, even if you didn't do it yourself. Also, @INC normally contains more entries than just the one shown in your error message, so unless that got cut off, that's another indicator of a problem with the install.

Re: @inc problem
by sundialsvc4 (Abbot) on May 06, 2014 at 16:17 UTC

    If you enter the command, perl -V (with a capital “V”), you will see, among many other things, the complete library path search-list that Perl is using.   This is the initial content of @INC.

    There are several places where this variable is populated.   The base list is compiled directly into the interpreter when it is built.   The list is ordinarily added-to from the PERL5LIB environment-variable, which could be set in a number of ways ... a globally-available system script, the hidden .bashrc file, or, in Windows, a completely-different strategy which uses the system registry.

    The first problem here, given that the system has been “restored,” is to determine whether what you’ve got right now is complete.   Was there, at some time in the past, another copy of this module, which would have superseded the one you’ve found now?   Are you now running the correct version of the Perl interpreter?   And so forth ... what was the “correct” state, before the excrement hit the air-movement device prompting a restore?   When you restored whatever-you-did, how exactly does present-state differ from that?   (Do you, for example, have another server at your disposal, which didn’t take a hit, which could be used for reference?)   Simply “re-installing” will only repair the core installation ... but you also must consider the correct operation of (and, a complete inventory of!) CPAN modules that might have separately been added thereafter.   You’ll need to thoroughly map-out what the correct final-state consists of.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1085195]
Approved by vinoth.ree
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-03-29 09:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found