Using CPAN shell
To install any of the above, we STRONGLY recommend using the CPAN shell. To
learn more about using CPAN run 'perldoc CPAN' or 'man CPAN'. If you plan to
install the modules in the default perl library, you will need to run it as
root. In short:
$ su 'type-your-root-password'
$ perl -MCPAN -e shell
If the person who installed perl has not yet configured CPAN, it
will ask you the following question:
Are you ready for manual configuration? [yes]
Just type 'no' and hit enter. Perl will auto-configure CPAN for
you, and this should work fine. However, if the person who installed
CPAN did not configure the URL list, it will force you to
proceed. The defaults should all work fine, and when you get to the
URL configuration, just pick a server close to you.
You should now get the CPAN prompt, 'cpan> ', to download,
configure, test, and install any perl module, just type:
install Full::Module::Name
at the 'cpan>' prompt. One other really nice feature of CPAN, is
that if a module has defined pre-requisites, then CPAN will pause
building the current module and fetch, build, and install the
pre-requisites first, then continue building the current module.
For example, to install 'CGI.pm' enter:
cpan> install CGI
Perl will first download a number of module control files, and
then fetch the CGI tarball, and will automatically run the normal
perl module install procedure:
- perl Makefile.PL
- make
- make test
- make install
If, for some reason, if Perl encounters errors while running make
test, Perl will halt and will not install the module. If you decide
it is a minor error, and want to install anyway, you can enter the
following:
cpan> force install Full::Module::Name
and perl will not stop at errors.
If you don't know exactly what you need to install you can ask the
CPAN shell for some hints:
cpan> i /CGI/
asks for all info on names that contain 'CGI' (which are quite
numerous). You can then select the one you need and install it.
Remember, before starting cpan to install DBD::Pg, you must set the
POSTGRES_INCLUDE and POSTGRES_LIB environment variables, or the
build will fail at the 'perl Makefile.PL' phase.
|