Installing modules with CPAN is pretty simple. From the command line:
% perl -MCPAN -e shell
... initial setup stuff, if needed...
cpan> install LWP::Simple
Assuming that all the tests pass, your module will be installed.
| [reply] [d/l] |
Thanks but what is the initial setup stuff? And when you install LWP::Simple should I be in the usr/local/lib/perl5 directory???
| [reply] |
The initial setup stuff only needs to be done once the first time you use CPAN. It involves picking a close CPAN server from a list and setting CPAN parameters. It starts up automatically and is self explanatory. Consequent times, CPAN comes up directly with a welcome message and cpan> prompt.
It is not necessary to go to a particular directory; CPAN will find and install the module in the proper directory. You will want to be superuser when invoking CPAN so that you have permission to write to the /usr subdirectories.
I encourage you play around with the CPAN interactive shell. It is fun and easy.
| [reply] [d/l] |
perldoc perlmodinstall
perldoc CPAN
| [reply] [d/l] |
One other caveat I would throw out there, and maybe this is just something funky with our solaris boxes at the office, but we find that the installed modules sometimes need to be chmod'd so that they can be usable (for some reason, things come out 0440 and 0660 - no world permission to, say, load the module ;) ). Other than that, read the faq (http://www.cpan.org/misc/cpan-faq.html)
"I have never written bad code. There are merely unanticipated features."
| [reply] |