How To Install liblexical-underscore-perl on Ubuntu
Posted on April 1, 2023  (Last modified on May 20, 2023 )
3 minutes • 446 words
Introduction
In this tutorial we learn how to install liblexical-underscore-perl on Ubuntu.
What is liblexical-underscore-perl
liblexical-underscore-perl is:
Starting with Perl 5.10, it is possible to create a lexical version of the Perl default variable $. Certain Perl constructs like the “given” keyword automatically use a lexical $ rather than the global $_.
It is occasionallly useful for a sub to be able to access its caller’s $_ variable regardless of whether it was lexical or not. The “()” sub prototype is the official way to do so, however there are sometimes disadvantages to this; in particular it can only appear as the final required argument in a prototype, and there is no way of the sub differentiating between an explicitly passed argument and $.
lexical::underscore allows you to access your caller’s lexical $_ variable as easily as:
${lexical::underscore()}
There are three methods to install liblexical-underscore-perl on Ubuntu. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.
Install liblexical-underscore-perl Using apt-get
Update apt database with apt-get using the following command.
sudo apt-get update
After updating apt database, We can install liblexical-underscore-perl using apt-get by running the following command:
sudo apt-get -y install liblexical-underscore-perl
Install liblexical-underscore-perl Using apt
Update apt database with apt using the following command.
sudo apt update
After updating apt database, We can install liblexical-underscore-perl using apt by running the following command:
sudo apt -y install liblexical-underscore-perl
Install liblexical-underscore-perl Using aptitude
If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.
sudo aptitude update
After updating apt database, We can install liblexical-underscore-perl using aptitude by running the following command:
sudo aptitude -y install liblexical-underscore-perl
How To Uninstall liblexical-underscore-perl on Ubuntu
To uninstall only the liblexical-underscore-perl package we can use the following command:
sudo apt-get remove liblexical-underscore-perl
Uninstall liblexical-underscore-perl And Its Dependencies
To uninstall liblexical-underscore-perl and its dependencies that are no longer needed by Ubuntu, we can use the command below:
sudo apt-get -y autoremove liblexical-underscore-perl
Remove liblexical-underscore-perl Configurations and Data
To remove liblexical-underscore-perl configuration and data from Ubuntu we can use the following command:
sudo apt-get -y purge liblexical-underscore-perl
Remove liblexical-underscore-perl configuration, data, and all of its dependencies
We can use the following command to remove liblexical-underscore-perl configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge liblexical-underscore-perl
Dependencies
liblexical-underscore-perl have the following dependencies:
References
Summary
In this tutorial we learn how to install liblexical-underscore-perl package on Ubuntu using different package management tools: apt, apt-get and aptitude.