Install Perl Module from Source Code

This section provides a tutorial on how to install Perl module from source code using the 'make' utility manually on macOS.

Since most Perl module packages includes a Makefile script, you can always install a Perl from source code manually using the "make" tool.

Here is what I did to install the File:Util module from source code using the "make" tool.

1. Go to File::Util Website at metacpan.org/pod/File::Util.

2. Click "Download" on the left menu. The download file, File-Util-4.161950.tar, will be saved in your "Downloads" directory.

3. Start a Terminal window and run the following commands to prepare the installation:

herong$ cd ~/Downloads

herong$ tar -xf File-Util-4.161950.tar

herong$ cd File-Util-4.161950

herong$ perl Makefile.PL

4. Use the "make" utility to install File::Util. If macOS prompts you to install "Xcode", click "Install" to install it.

herong$ make test

herong$ sudo make install
(Enter admin password)

Now you can enjoy functionalities provided by File::Util as in the following Perl script:

  use File::Util;

  $nl = File::Util->NL; # new line separator
  $slash = File::Util->SL; # directory separator
  $os = File::Util->OS; # system identifier

  print "..${slash}..${slash} -- grand parent directory$nl";

  if ($os =~ /UNIX/) {
    print "I on a Unix/Linux system$nl";
  }

Table of Contents

 About This Book

 Perl on Linux Systems

 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

Managing Perl Engine and Modules on macOS

 Perl Version Pre-Installed on macOS

 Install Xcode Command Line Tools

 Configure CPAN Shell

 Install Perl Module from CPAN

Install Perl Module from Source Code

 Archived Tutorials

 References

 Full Version in PDF/EPUB