ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
we just bought a web-project which uses perl scripts.
Now we have a problem to get it up and running. The guy who wrote the whole thing did not leave his perl scripts in the regular folders which are defined in @INC but in a different one.
Well one way to get it to work is to edit every single file and add the line use "/my/dir/" but that is not an option since there are hundreds of files.
Is there any way to edit the @INC array globally so that I can add the dir to it?
If you can afford a change to the way Perl is invoked, you can use the -I option to add the immediately proceding directory to the @INC array. For example, `perl -I/my/dir script.pl`. I'm pretty sure that will not overwrite what's already in @INC, but I'm not positive. You'll find out the first time you try it; but don't worry, it won't damage anything.
OK, according to some mod_perl documentation, modifying @INC during script execution will not affect anything other than the currently executing script, so that's out. But, it does say you can change @INC to take effect at server startup and therefore be used by any script that may run. Summarised, you should be able to do
I'll admit that I don't know much about mod_perl, but from this post it seems like it might have to be inside a <Location> block. If that doesn't work, I'm not sure. You might also want to check out the Practical mod_perl book.
Edit: Also, take a look at the logs, if you've got access to them. At best case, something is writing some error messages in there that will make everything clear.
Last edited by taylor_venable; 05-02-2006 at 02:07 PM.