Solved

Adding to @INC without modifying existing scripts

Posted on 2004-09-29
3
181 Views
Last Modified: 2010-03-05
Hi experts,

Is there a way to add to @INC without modifying our existing scripts. This is because the directory of some of the libraries has moved to a different directory and as there are a lot of existing scripts, I would like to avoid modifying each one of them.

Would appreciate it if anyone could provide some pointers.

Cheers,
Ben
0
Comment
Question by:bcheong
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 12

Accepted Solution

by:
stefan73 earned 125 total points
ID: 12178155
Hi bcheong,
You can either add the new paths to the PERL5LIB environment, or you can use the -I command line switch to add your new directories to @INC.

Cheers!

Stefan
0
 
LVL 13

Expert Comment

by:gripe
ID: 12179762
You could also recompile Perl and modify @INC permanently during the compile steps. Just run the 'Configure' program and it will prompt you for additional paths to add to @INC.
0
 
LVL 3

Expert Comment

by:Felix2000
ID: 12235856
#!/usr/bin/perl
push @INC, "/var/www/cgi-bin";

replace /var/www/cgi-bin with whatever directory you need.

Hope it helps

-= Felix =-
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question