Install File::Util for Perl

This section provides a tutorial on how to install Perl File::Util module from the download .tar file using the 'make' utility on macOS.

If you want to Perl scripts to handle file paths on both Unix and Windows systems, you should install and use the File::Util module as shown in this tutorial.

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

 Macintosh OS (Operating System) History

 macOS Operating System

 macOS File Systems

 macOS Network Connections

 System and Application Processes

 Keychain Access - Password Manager

 Keychain Access - Certificate Manager

 Productivity Tools on macOS

Programming Tools on macOS

 Run Perl Scripts on macOS

Install File::Util for Perl

 Run Python Scripts on macOS

 Install New Version of Python on macOS

 pip3 - Package Installer for Python 3

 Run PHP Scripts on macOS

 Install MySQL Database Server on macOS

 PHP mysqli_connect() Error on "localhost"

 Install SQuirreL SQL Client on macOS

 Connect SQuirreL to MySQL on macOS

 Install SQuirreL SQL Scripts Plugins

 Apache Web Server on macOS

 Develop and Run Java Applications

 Full Version in PDF/EPUB