Run a perl script using libraries in nonstandard locations.
======================================
Use perl -V to see the include paths @INC array
I will be something like :
/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
1. Using the module lib
===============
The standard module lib can be used to specify an explicit path to include. It must be stated at the
top of the script:
#!/usr/bin/perl
#
use lib “/opt/special/plib”;
use strict;
use warnings;
2. Using the switch -I at the command line
============================
The switch I can be used to specify additional library locations when invoking the interpreter.
perl -I /opt/special/plib script.pl
3. Using the switch -I in the first line of the script
=================================
The same I switch can be added to the interpreter specification.
#!/usr/bin/perl -I /opt/special/plib
#
use strict;
use warnings;
..
This works when invoking the script via the shell (which will run the interpreter with full
options and arguments as specified in the first line) and also when invoking the interpreter
directly: It apparently scans the first line for options.
4. Manipulating @INC directly
====================
The array @INC can be manipulated directly using array operations :
#!/usr/bin/perl
#
BEGIN {
unshift(@INC, “/opt/special/plib”);
}
use strict;
use warnings;
5. Using the environment variable PERL5LIB
==============================
The environment variable PERL5LIB can be used to specify additional include directories whe
running a perl script.
> export PERL5LIB=/opt/special/plib
6. Changing @INC at compile time
=======================
When running Configure to compile the perl interpreter itself, there are several possibilities to add
additional library path elements:
· Using the variable vendorprefix
· Using the variable otherlibdirs
Both must be specified when calling Configure as a define, eg
> sh Configure -Dotherlibdirs=/opt/special/plib
The variable otherlibdirs is preferred, as it can hold mutliple values separated by a colon just like
the familiar PATH environment variable.
Details about compiling perl can be found on the CPAN network :
http://search.cpan.org/~nwclark/perl5.8.3/INSTALL.
Buy:Lumigan.Arimidex.Retin-A.Petcam (Metacam) Oral Suspension.Prevacid.100% Pure Okinawan Coral Calcium.Valtrex.Mega Hoodia.Actos.Zovirax.Nexium.Zyban.Prednisolone.Accutane.Human Growth Hormone.Synthroid….