How To Install perl-Carp.noarch on Amazon Linux 2

In this tutorial we learn how to install perl-Carp.noarch in Amazon Linux 2. perl-Carp.noarch is Alternative warn and die for modules

Introduction

In this tutorial we learn how to install perl-Carp.noarch on Amazon Linux 2.

What is perl-Carp.noarch

The Carp routines are useful in your own modules because they act like die() or warn(), but with a message which is more likely to be useful to a user of your module. In the case of cluck, confess, and longmess that context is a summary of every call in the call-stack. For a shorter message you can use carp or croak which report the error as being from where your module was called. There is no guarantee that that is where the error was, but it is a good educated guess.

We can use yum to install perl-Carp.noarch on Amazon Linux 2. In this tutorial we discuss both methods but you only need to choose one of method to install perl-Carp.noarch.

Install perl-Carp.noarch on Amazon Linux 2 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

After updating yum database, We can install perl-Carp.noarch using yum by running the following command:

sudo yum -y install perl-Carp.noarch

How To Uninstall perl-Carp.noarch on Amazon Linux 2

To uninstall only the perl-Carp.noarch package we can use the following command:

sudo yum remove perl-Carp.noarch

perl-Carp.noarch Package Contents on Amazon Linux 2

/usr/share/doc/perl-Carp-1.26
/usr/share/doc/perl-Carp-1.26/Changes
/usr/share/doc/perl-Carp-1.26/README
/usr/share/man/man3/Carp.3pm.gz
/usr/share/perl5/vendor_perl/Carp
/usr/share/perl5/vendor_perl/Carp.pm
/usr/share/perl5/vendor_perl/Carp/Heavy.pm

References

Summary

In this tutorial we learn how to install perl-Carp.noarch on Amazon Linux 2 using yum.