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.
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:
Then, Save and exit this file.
To run this program, follow the below command:
$ perl hello.pl