How To Install libclass-autoloadcan-perl on Ubuntu 18.04

In this tutorial we learn how to install libclass-autoloadcan-perl on Ubuntu 18.04. libclass-autoloadcan-perl is module managing conflict between AUTOLOAD, can and inheritance

Introduction

In this tutorial we learn how to install libclass-autoloadcan-perl on Ubuntu 18.04.

What is libclass-autoloadcan-perl

libclass-autoloadcan-perl is:

Class::AutoloadCAN solves a fundamental conflict between AUTOLOAD, can and inheritance. The problem is that while you can implement anything in AUTOLOAD, UNIVERSAL::can is not aware that it is there. Attempting to modify UNIVERSAL::can to document those methods is very hard. And if a parent class uses AUTOLOAD then subclasses have to do a lot of work to make their AUTOLOADs cooperate with the parent one. It is harder still if 2 parent classes in a multiple inheritance tree wish to cooperate with each other. Few try to do this, which may be good since those who try usually get it wrong. See http://www.perlmonks.org/?node_id=342804 for a fuller discussion.

With this module instead of writing AUTOLOADs, you write CANs. Based on what they return, Class::AutoloadCAN will decide whether you handle the call or it needs to search higher up the inheritance chain.

There are three methods to install libclass-autoloadcan-perl on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install libclass-autoloadcan-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 libclass-autoloadcan-perl using apt-get by running the following command:

sudo apt-get -y install libclass-autoloadcan-perl

Install libclass-autoloadcan-perl Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install libclass-autoloadcan-perl using apt by running the following command:

sudo apt -y install libclass-autoloadcan-perl

Install libclass-autoloadcan-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 libclass-autoloadcan-perl using aptitude by running the following command:

sudo aptitude -y install libclass-autoloadcan-perl

How To Uninstall libclass-autoloadcan-perl on Ubuntu 18.04

To uninstall only the libclass-autoloadcan-perl package we can use the following command:

sudo apt-get remove libclass-autoloadcan-perl

Uninstall libclass-autoloadcan-perl And Its Dependencies

To uninstall libclass-autoloadcan-perl and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove libclass-autoloadcan-perl

Remove libclass-autoloadcan-perl Configurations and Data

To remove libclass-autoloadcan-perl configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge libclass-autoloadcan-perl

Remove libclass-autoloadcan-perl configuration, data, and all of its dependencies

We can use the following command to remove libclass-autoloadcan-perl configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge libclass-autoloadcan-perl

References

Summary

In this tutorial we learn how to install libclass-autoloadcan-perl package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.