How To Install perl on CentOS 7

In this tutorial we learn how to install perl on CentOS 7. perl is Practical Extraction and Report Language

Introduction

In this tutorial we learn how to install perl on CentOS 7.

What is perl

Perl is a high-level programming language with roots in C, sed, awk and shell scripting. Perl is good at handling processes and files, and is especially good at handling text. Perl’s hallmarks are practicality and efficiency. While it is used to do a lot of different things, Perl’s most common applications are system administration utilities and web programming. A large proportion of the CGI scripts on the web are written in Perl. You need the perl package installed on your system so that your system can handle Perl scripts. Install this package if you want to program in Perl or enable your system to handle Perl scripts.

We can use yum or dnf to install perl on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install perl.

Install perl on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install perl using yum by running the following command:

sudo yum -y install perl

Install perl on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install perl using dnf by running the following command:

sudo dnf -y install perl

How To Uninstall perl on CentOS 7

To uninstall only the perl package we can use the following command:

sudo dnf remove perl

References

Summary

In this tutorial we learn how to install perl on CentOS 7 using yum and dnf.