How To Install perl-Try-Tiny on CentOS 7

In this tutorial we learn how to install perl-Try-Tiny on CentOS 7. perl-Try-Tiny is Minimal try/catch with proper localization of $@

Introduction

In this tutorial we learn how to install perl-Try-Tiny on CentOS 7.

What is perl-Try-Tiny

This module provides bare bones try/catch statements that are designed to minimize common mistakes with eval blocks, and NOTHING else. This is unlike TryCatch, which provides a nice syntax and avoids adding another call stack layer, and supports calling return from the try block to return from the parent subroutine. These extra features come at a cost of a few dependencies, namely Devel and the additional catch filtering uses Moose type constraints, which may not be desirable either.

We can use yum or dnf to install perl-Try-Tiny on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install perl-Try-Tiny.

Install perl-Try-Tiny on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install perl-Try-Tiny using yum by running the following command:

sudo yum -y install perl-Try-Tiny

Install perl-Try-Tiny on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install perl-Try-Tiny using dnf by running the following command:

sudo dnf -y install perl-Try-Tiny

How To Uninstall perl-Try-Tiny on CentOS 7

To uninstall only the perl-Try-Tiny package we can use the following command:

sudo dnf remove perl-Try-Tiny

References

Summary

In this tutorial we learn how to install perl-Try-Tiny on CentOS 7 using yum and dnf.