How To Install libclone-pp-perl on Ubuntu 18.04

In this tutorial we learn how to install libclone-pp-perl on Ubuntu 18.04. libclone-pp-perl is module to recursively copy Perl datatypes

Introduction

In this tutorial we learn how to install libclone-pp-perl on Ubuntu 18.04.

What is libclone-pp-perl

libclone-pp-perl is:

Clone::PP provides a general-purpose clone function to make deep copies of Perl data structures. It calls itself recursively to copy nested hash, array, scalar and reference types, including tied variables and objects.

The clone() function takes a scalar argument to copy. To duplicate arrays or hashes, pass them in by reference:

my $copy = clone(@array); my @copy = @{ clone(@array) }; my $copy = clone(%hash); my %copy = %{ clone(%hash) };

The clone() function also accepts an optional second parameter that can be used to limit the depth of the copy. If you pass a limit of 0, clone will return the same value you supplied; for a limit of 1, a shallow copy is constructed; for a limit of 2, two layers of copying are done, and so on.

This is a pure-perl implementation. For a faster XS-/C-based implementation see the libclone-perl package.

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

sudo apt-get -y install libclone-pp-perl

Install libclone-pp-perl Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install libclone-pp-perl

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

sudo aptitude -y install libclone-pp-perl

How To Uninstall libclone-pp-perl on Ubuntu 18.04

To uninstall only the libclone-pp-perl package we can use the following command:

sudo apt-get remove libclone-pp-perl

Uninstall libclone-pp-perl And Its Dependencies

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

sudo apt-get -y autoremove libclone-pp-perl

Remove libclone-pp-perl Configurations and Data

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

sudo apt-get -y purge libclone-pp-perl

Remove libclone-pp-perl configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge libclone-pp-perl

References

Summary

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