How To Install perl-Switch on Rocky Linux 8

In this tutorial we learn how to install perl-Switch on Rocky Linux 8. perl-Switch is A switch statement for Perl

Introduction

In this tutorial we learn how to install perl-Switch on Rocky Linux 8.

What is perl-Switch

Switch.pm provides the syntax and semantics for an explicit case mechanism for Perl. The syntax is minimal, introducing only the keywords C and C and conforming to the general pattern of existing Perl control structures. The semantics are particularly rich, allowing any one (or more) of nearly 30 forms of matching to be used when comparing a switch value with its various cases.

We can use yum or dnf to install perl-Switch on Rocky Linux 8. In this tutorial we discuss both methods but you only need to choose one of method to install perl-Switch.

Install perl-Switch on Rocky Linux 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

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

sudo dnf -y install perl-Switch

Install perl-Switch on Rocky Linux 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

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

sudo yum -y install perl-Switch

How To Uninstall perl-Switch on Rocky Linux 8

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

sudo dnf remove perl-Switch

perl-Switch Package Contents on Rocky Linux 8

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

References

Summary

In this tutorial we learn how to install perl-Switch on Rocky Linux 8 using yum and dnf.