Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Adding to @INC without modifying existing scripts

Posted on 2004-09-29
3
Medium Priority
?
188 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 375 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

Independent Software Vendors: 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

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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…
Six Sigma Control Plans

926 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