How To Install libclass-std-storable-perl on Ubuntu 18.04

In this tutorial we learn how to install libclass-std-storable-perl on Ubuntu 18.04. libclass-std-storable-perl is Support for creating serializable inside-out classes

Introduction

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

What is libclass-std-storable-perl

libclass-std-storable-perl is:

Class::Std introduced the “inside-out” model for classes (perldoc Class::Std for details). Among its salient features is complete encapsulation; that is, an object’s data may only be accessed via its methods, unlike the usual hashref model that permits direct access by any code whatsoever. However, the drawback of complete encapsulation is that normal mechanisms for serialization won’t work, as they rely on direct access to an object’s attributes.

This class provides the class-building functionality from Class::Std, and in addition provides an interface to allow Storable to freeze and thaw any declared attributes of this class and any superclasses that were built via Class::Std::Storable.

However, in order to let Storable save attributes and construct the object, it is necessary to expose the attributes of the class to the world. Thus, any code could use the same interface that Storable does to get a copy of object attributes and create new objects with arbitrary attributes without going through the constructor. While the interface CAN’T be used to replace the existing attributes of an object, it COULD be used to create an arbitrarily mutated clone of an object without going through its methods. Also, if attributes are themselves references, then the objects to which they refer can be obtained and modified.

There are three methods to install libclass-std-storable-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-std-storable-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-std-storable-perl using apt-get by running the following command:

sudo apt-get -y install libclass-std-storable-perl

Install libclass-std-storable-perl Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install libclass-std-storable-perl

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

sudo aptitude -y install libclass-std-storable-perl

How To Uninstall libclass-std-storable-perl on Ubuntu 18.04

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

sudo apt-get remove libclass-std-storable-perl

Uninstall libclass-std-storable-perl And Its Dependencies

To uninstall libclass-std-storable-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-std-storable-perl

Remove libclass-std-storable-perl Configurations and Data

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

sudo apt-get -y purge libclass-std-storable-perl

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

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

sudo apt-get -y autoremove --purge libclass-std-storable-perl

References

Summary

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