Adding to @INC

wdatkinson

Verified User
Joined
Nov 18, 2004
Messages
56
Location
Indianapolis, IN
One of our customers needed a perl module installed. I went in as root and installed the required module via CPAN. CPAN put the module here:

/usr/lib/perl5/site_perl/5.8.0/Astro

@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0

As a work around, I've copied the module to /usr/lib/perl5/5.8.0 and the script it working, but to keep things clean, I'd like to know how I can add a path to the @INC variable.
 
If nobody comes up with a solid answer you might try the mailing lists or the perl channel on irc.freenode.net
 
Hello,

At the beginning of your Perl script you could add:
Code:
use lib '/usr/lib/perl5/site_perl/5.8.0/Astro';
However, I'm not sure how you'd automatically get that there.

Good luck.
 
Back
Top