Perl is commonly referred to as “Practical Extraction and Reporting Language”. It is open-source and free software thus no worry of money while using Perl. It runs on most operating systems and can be easily migrated to different operating systems.
From the beginning, Perl was designed to simplify simple work without losing the ability to handle difficult problems. It makes it easy to manipulate numbers, text, files and directories, computers and networks, especially the language of programs. Perl was originally designed as a Unix scripting language, but it has long been ported to most other operating systems. Because Perl can be run almost anywhere, Perl can be said to be the most portable programming environment today to write portable C/C++ programs.
Here in this tutorial, we will know how to install it on Ubuntu Linux operating systems such as Ubuntu 16.04/18.04/18.10/19.04 including Linux Mint.
- Open Ubuntu Command Terminal to install Perl latest stable version. For that, you can use Keyboard shortcut Ctrl+Alt+T.
- Either log in as root or your current Ubuntu user should have access of sudo.
- Run system update command to get the latest version of already installed packages.
sudo apt update
- Perl comes in the default repository of Ubuntu, thus no need to add any third-party repo.
- Run the Perl installation command:
sudo apt-get install perl
- Check installed Perl version.
- In our case, it was Perl v5.26.
- Now, if you want to install Perl modules, which are set of codes used in carrying out or run some certain programs based on Perl. Thus, you can use CPAN (Comprehensive Perl Archive Network) it features a wide range of Perl modules and same can be installed for Perl using its commands.
- The below command will install cpanminus which is basically a script used to install modules for Perl from CPAN and it performs unpacking and building of the same. Here is the command to Install App-cpanminus Perl module.
- After the installation of CPAN’s cpanminus, if you want to install any Perl module, run cpan install moudle-name command. For example, if we want to install Gtk2 module, then simply run:
sudo cpan install YAML
- In this way, we can install Perl and its modules on Ubuntu Linux or its based operating systems.