Install Perl on Ubuntu 20.04 - Step by step guide ?

Perl is a programming language that is responsible for creating different algorithms. It is used for administration, GUI development and Web development.

The Perl database interface also supports third-party databases such as Postgre, MySql, and Oracle. Markup languages like HTML also work with Perl.

Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform related Perl queries.

In this context, we shall look into how to install Perl on Ubuntu 20.04.


How to install Perl on Ubuntu ?

1. Perform system update

Update the system's package with the below command:

$ sudo apt update

2. Install Perl on the system

To do this, Run the apt command:

$ sudo apt install perl


How to check Perl's list of installed packages ?

To do this, Run the following command:

$ apt list --installed | grep -i perl

You can check its version by running the below command:

$ perl -v


Examples of using Perl on Ubuntu

Firstly, you create a file ending with *.pl. Here we will create a file named hello.pl:

$ nano hello.pl

Then type the following lines:

#!/usr/bin/perl

use warnings;
print("Hello World!")

Then, Save and exit this file.

To run this program, follow the below command:

$ perl hello.pl


[Need help in fixing Perl issues ? We can help you. ]

This article covers how to install Perl on Ubuntu 20.04. In fact, Perl is a general-purpose, high-level, interpreted programming language. It is the acronym of Practical Extraction and Reporting Language, initially, Perl was designed as a scripting language to make report processing easier.


How to install Perl in Ubuntu ?

1. Refresh the local package repository and upgrade all packages to a newer version:

$ sudo apt update && sudo apt upgrade -y

2. Once your system gets updated, use the following command to install Perl in your system:

$ sudo apt install perl

Related Posts