Categories: TutorialsUbuntu

How to Install Perl on Ubuntu 20.04

Introduction

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.

And we will guide you on how to install Perl on Ubuntu 20.04 as we did below. Hope you understand.

Installing Perl

Step 1 – Update the package

Run:

$ sudo apt update

Output:

Sponsored

Step 2 – Install Perl

Run the apt command:

$ sudo apt install perl

Output:

Checking Perl’s list of installed packages

Run the following command:

$ apt list --installed | grep -i perl

Output:

Sponsored

You can check its version by:

$ perl -v

Output:

For example

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

$ nano hello.pl

Then type the following lines:

#!/usr/bin/perl

use warnings;

print("Hello World!")

Save and exit.

To run:

$ perl hello.pl

Output:

Conclusion

We have shown you how to install Perl on Ubuntu 20.04.

Thanks for referring!

Ubuntu Server Admin

Recent Posts

Ubuntu Weekly Newsletter Issue 899

Welcome to the Ubuntu Weekly Newsletter, Issue 899 for the week of June 29 –…

15 hours ago

The State of Silicon and Devices – Q2 2025 Roundup

Welcome to the Q2 2025 edition of the State of Silicon and Devices by Canonical.…

22 hours ago

How To Upgrade Zabbix 6.0 To 6.4 on Ubuntu 22.04

In tis tutorial how to upgrade zabbix 6.0 to 6.4 using ubuntu 22.04. This is…

2 days ago

JetPack 4 EOL – how to keep your userspace secure during migration

NVIDIA JetPack 4 reached its end-of-life (EOL) in November 2024, marking the end of security…

5 days ago

Source to production: Spring Boot containers made easy

This blog is contributed by Pushkar Kulkarni, a Software Engineer at Canonical. Building on the…

6 days ago

Spring support available on Ubuntu

This blog is contributed by Vladimir Petko, a Software Engineer at Canonical. The release of…

6 days ago