14 C
Jaipur
Sunday, November 29, 2020

How to Install Perl Modules on Debian Linux? – Linux Hint

Must read

Gaming laptop deal: save $390 on the Dell G5 15 in the early Cyber Monday sale

We've just spotted a fantastic gaming laptop deal over on the official Dell website for anyone looking for a solid first step into the...

Where to buy Oculus Quest 2 on Cyber Monday – and why are there no deals?

Looking for Oculus Quest 2 Cyber Monday deals? Unfortunately, we haven't really seen any across the Black Friday weekend. In fact, the VR headset...

See how iPhone XR deals came down to only £20 a month this Black Friday weekend

If you're in the market for a fairly priced iPhone, it's likely you'll have considered some iPhone XR deals before. While it's not quite...

Xbox Series X controllers are at their best price yet for Cyber Monday

If you're after a good Xbox Series X Cyber Monday deal, these Xbox Series X controllers should do just the trick. You'll find a...

Perl is a very popular high-level programming language. It is a scripting language, in fact, whose syntax resembles closely with C and C++. A Perl module is defined as a collection of related functions. It is very much similar to the concept of libraries is C++ and Java. This means that if you intend to run a function in Perl, you must have the respective module for that function installed on your system. That is why in this article, we will be learning the method of installing Perl modules on Debian 10.

Method of Installing Perl Modules on Debian Linux:

For installing Perl modules on Debian 10, you will have to go through all the steps listed below:

Step # 1: Installing Perl on Debian 10:

First of all, you need to have Perl installed on your Debian 10 system. For that, you will launch the terminal in Debian 10 by looking for it in the Activities menu. The Debian 10 terminal can be seen in the following image:

Now you have to run the following command in your terminal to install Perl on your Debian 10 system:

sudo apt-get install Perl

Once the installation of Perl completes successfully, the output shown in the image below will be displayed on your Debian 10 terminal:

Step # 2: Updating System Cache:

Before installing Perl modules, you are advised to update your system’s cache with the following command:

Once all the required packages and dependencies have been updated, you will be able to witness the following output on your Debian 10 terminal:

Step # 3: Installing CPAN on Debian 10:

The best way of installing Perl modules on Debian 10 is via the CPAN repository. For doing so, we first need to install this repository on our Debian 10 system, which can be done with the below-mentioned command:

sudo apt-get install libpath-tiny-Perl

During the installation of the CPAN repository, you need to type “Y” in your terminal for carrying on with its execution as highlighted in the following image:

Once the CPAN repository has been successfully installed on your Debian 10 system, the terminal will produce the output shown in the image below:

Step # 4: Launching and Configuring the CPAN Interactive Shell:

For installing Perl modules with CPAN, you first need to launch and configure the CPAN interactive shell, which can be done simply by running the following command in your terminal:

cpan

As soon as you try to launch the CPAN interactive shell with the above-mentioned command, you will be asked to configure it. You have to type in “yes” and then press the Enter key as highlighted in the image shown below:

After doing this, you will be asked to choose an approach with which you want to install your modules. The approach chosen by default is “[local: lib],” and it is also the recommended approach. Therefore, for selecting this approach, you simply need to press the Enter key, as shown in the following image:

It will take a few seconds for the automatic configuration process of CPAN to complete, after which the CPAN interactive shell will appear on your screen as shown in the image below:

Step # 5: Installing Perl Modules via CPAN on Debian 10:

Now you can visit the following site: http://www.cpan.org/modules/index.html to look for any module of your choice that you want to install. After choosing a module to install, you are supposed to run the following command in your CPAN interactive shell:

Here, you have to replace ModuleName with the name of the specific module that you want to install via CPAN on your Debian 10 system. For the sake of demonstration, we will be installing the MIME: Lite module, as shown in the image below:

Once the desired module has been installed on your Debian 10 system, your CPAN interactive shell will look something like shown in the following image. In the same manner, you can also install any other Perl module of your choice. Once you are done with the installation, and you want to go back to your regular terminal, you can simply type the “exit” command followed by pressing the Enter key to switch from your CPAN interactive shell to your Debian 10 terminal as shown in the following image:

Conclusion:

By using the simple method described in this article, one can easily install as many Perl modules as he wants or according to his requirements. In this way, you will be all set to create Perl scripts from very basic to extremely complex.

Source link

- Advertisement -

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

Gaming laptop deal: save $390 on the Dell G5 15 in the early Cyber Monday sale

We've just spotted a fantastic gaming laptop deal over on the official Dell website for anyone looking for a solid first step into the...

Where to buy Oculus Quest 2 on Cyber Monday – and why are there no deals?

Looking for Oculus Quest 2 Cyber Monday deals? Unfortunately, we haven't really seen any across the Black Friday weekend. In fact, the VR headset...

See how iPhone XR deals came down to only £20 a month this Black Friday weekend

If you're in the market for a fairly priced iPhone, it's likely you'll have considered some iPhone XR deals before. While it's not quite...

Xbox Series X controllers are at their best price yet for Cyber Monday

If you're after a good Xbox Series X Cyber Monday deal, these Xbox Series X controllers should do just the trick. You'll find a...

Incredible Cyber Monday deal: save £1,877 on this 55-inch Alienware gaming OLED monitor

Dell has stolen the limelight this sales season with the Alienware 55-inch AW5520QF getting a major £1,877 price cut – and this stellar early...