You are on page 1of 3

How to install Perl on Ubuntu

For the installation of the Perl on Ubuntu, open the terminal and update as well upgrade the repository:

 $ sudo apt update

Now to upgrade:

$ $ sudo apt upgrade

Run the installation command of the Perl installation as:

$ sudo apt install perl

The above command will install the Perl including its packages and dependencies. Now to verify the
installation we will check the list of the installed packages of Perl.

$ apt list --installed | grep -i perl
We can also verify its installation by checking its version:

$ perl –v

Now we will create a simple text file and will run in the Perl. We will create the
following program just to print something:
#!/usr/bin/perl

use warnings;

print(”Hey!! This is my first perl Program”)

Now save the above file with .pl extension, we save the file with name,
myfile.pl. Run the Perl file as

$ perl myfile.pl
We can see our output:

-v

You might also like