6. "Using a Perl module that is not in the
standard Perl distribution"
One of the nice features about Perl is that you hardly ever have to do much
programming but there is a wide range of modules available doing almost
everything you can imagine. In addition that these modules are usually quite
well documented, you can also rely on them being already sufficiently
debugged.
Modules that are not included in the standard perl distribution can be
easily obtained from several places e.g. CPAN
(Comprehensive Perl Archive Network) or ActiveState.
However you have to put them into a location where PERL finds them or tell
Perl to look for them where you put them !
i) Create a directory within your Web-site for the additional Perl modules
you want to use, call it e.g.
'perllib'
ii) Copy the perlmodule that into
the directory
ii) From within your perl-script
you have to include the 'perllib' directory to
the library search path. Add something similar to the following to your
Perl-script:
use lib "\Full\path\to\perllib";
Then you can use the 'new' module as any other module, e.g.
use lib "\Full\path\to\perllib";
use strict;
use YourModuleName;
# your code to follow ...
|
![](../images/warning.gif) |
If
you don't specify the correct path in the 'use lib' statement you will get
a quite understandable error message that the 'YourModuleName'
module can not be located
!!! |