Solved

Adding to @INC without modifying existing scripts

Posted on 2004-09-29
3
177 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
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…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

867 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now