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 a 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[1]>

Now you can use the CPAN module to install and manage other perl modules from the CPAN repository. See CPAN tutorials for more details.

Table of Contents

 About This Book

 Perl on Linux Systems

Perl on macOS Computers

 Perl Version Pre-Installed on macOS

 Install Xcode Command Line Tools

Configure CPAN Shell

 Install Perl Module from Source Code

 ActivePerl on Windows Systems

 Data Types: Values and Variables

 Expressions, Operations and Simple Statements

 User Defined Subroutines

 Perl Built-in Debugger

 Name Spaces and Perl Module Files

 Symbolic (or Soft) References

 Hard References - Addresses of Memory Objects

 Objects (or References) and Classes (or Packages)

 Typeglob and Importing Identifiers from Other Packages

 String Built-in Functions and Performance

 File Handles and Data Input/Output

 Open Files in Binary Mode

 Open Directories and Read File Names

 File System Functions and Operations

 Image and Picture Processing

 Using DBM Database Files

 Using MySQL Database Server

 Socket Communication Over the Internet

 XML::Simple Module - XML Parser and Generator

 XML Communication Model

 SOAP::Lite - SOAP Server-Client Communication Module

 Perl Programs as IIS Server CGI Scripts

 CGI (Common Gateway Interface)

 XML-RPC - Remote Procedure Call with XML and HTTP

 RPC::XML - Perl Implementation of XML-RPC

 Integrating Perl with Apache Web Server

 CGI.pm Module for Building Web Pages

 LWP::UserAgent and Web Site Testing

 Converting Perl Script to Executable Binary

 CPAN (Comprehensive Perl Archive Network)

 Archived Tutorials

 References

 Full Version in PDF/EPUB