Perl Tutorials - Herong's Tutorial Examples - 6.00, by Dr. Herong Yang
Configure CPAN Shell
This section provides a tutorial on how to configure CPAN Shell to manage Perl module installations on macOS.
CPAN (Comprehensive Perl Archive Network) is is a repository of over 250,000 Perl modules, written by over 12,000 contributors. See CPAN Website at https://www.cpan.org for more information.
CPAN Shell is Perl module that provides an shell interface to manage installations of CPAN Perl modules.
To use CPAN shell, you need to configure it first. Here is what I did on my macOS system.
1. Run the "perl -MCPAN -e shell" command:
herong$ perl -MCPAN -e shell CPAN.pm requires configuration, but most of it can be done automatically. If you answer 'no' below, you will enter an interactive dialog for each configuration option instead. Would you like to configure as much as possible automatically? [yes] yes ... Warning: You do not have write permission for Perl library directories. To install modules, you need to configure a local Perl library directory or escalate your privileges. CPAN can help you by bootstrapping the local::lib module or by configuring itself to use 'sudo' (if available). You may also resolve this problem manually if you need to customize your setup. What approach do you want? (Choose 'local::lib', 'sudo' or 'manual') [local::lib] sudo Autoconfigured everything but 'urllist'. Now you need to choose your CPAN mirror sites. You can let me pick mirrors for you, you can select them from a list or you can enter them by hand. Would you like me to automatically choose some CPAN mirror sites for you? (This means connecting to the Internet) [yes] yes Trying to fetch a mirror list from the Internet Fetching with LWP: http://www.perl.org/CPAN/MIRRORED.BY Fetching with LWP: http://www.perl.org/CPAN/MIRRORED.BY.gz Autoconfiguration complete. commit: wrote '/Users/herong/.cpan/CPAN/MyConfig.pm' You can re-run configuration any time with 'o conf init' in the CPAN shell Terminal does not support AddHistory. cpan shell -- CPAN exploration and modules installation (v2.00) Enter 'h' for help. cpan>
2. Get help on the CPAN Shell prompt:
cpan> help Display Information (ver 2.00) command argument description a,b,d,m WORD or /REGEXP/ about authors, bundles, distributions, modules i WORD or /REGEXP/ about any of the above ls AUTHOR or GLOB about files in the author's directory Download, Test, Make, Install... get download clean make clean make make (implies get) look open subshell in dist directory test make test (implies make) readm display these README files instal make install (implies test) perldo display POD documentation Upgrade r WORDs or /REGEXP/ or NONE report updates for matching modules upgrade WORDs or /REGEXP/ or NONE upgrade matching modules Pragmas force CMD try hard to do command fforce CMD try harder notest CMD skip testing Other h,? display this menu ! perl-code eval a perl command o conf [opt] set and query options q quit the cpan shell reload cpan load CPAN.pm again reload index load newer indices autobundle Snapshot recent latest CPAN uploads
Table of Contents