Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't locate files in @INC (??)

Status
Not open for further replies.

sm840817

Programmer
Jun 29, 2003
4
US
Hi I'm a newbie who just started to learn PERL recently. I install the PERL and all that, so some of the .pl & .cgi files work fine, but while i was trying to install the source i downloaded from the web, i received the following messeges

"Can't locate ./server/noboard/lib/headfoot.cgi in @INC (@INC contains: D:/perl/lib D:/perl/site/lib .) at d:\server\cgi-bin\nboard\nboard.cgi line 54."

I'm assuming that @INC (i have no idea what it is) is set to the PERL files on hard drive, when i need the directory to be set to its own default folders on the web. How can i change that? anyone know? sorry for my newbiness
 
No need to apologise - we've all been there.

@INC is an array of directories specifying where perl should look for libraries or modules. You can discover where these directories are by typing
[tt]perl -e 'print join("\n",@INC),"\n";'[/tt]
at a command prompt.

Libraries/Modules are usually loaded with lines like
[tt]use File::Find[/tt]
which would load a module called Find.pm in a subdirectory (called File) of one of the directories in @INC. Perl will search all the directories in @INC until it finds the module or gives up and generates an error.

Having said that, ./server/noboard/lib/headfoot.cgi does not sound anything like a perl library, which makes me think that there is something very odd going on near line 54 of d:\server\cgi-bin\nboard\nboard.cgi.

Perhaps we could help if you posted a little more context.

Yours,



fish

"As soon as we started programming, we found to our surprise that it wasn't as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs."
--Maurice Wilkes
 
It's also possible that the script is using a
Code:
require
clause at line 54. This was fairly common in older cgi scripts. Like fish said if you could post the code in that area we might be able to give you a better idea of what's going on.

Also search for
Code:
headfoot.cgi
and let use know where it is. It's possible that they have a use/require statement with a hardcoded path that doesn't quite match your layout.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top