Skip to content
This repository was archived by the owner on Jul 31, 2025. It is now read-only.

Commit 3774e46

Browse files
remove use of deprecated smartmatch operator
1 parent 19e074e commit 3774e46

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

check_netapp_ontap.pl

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
use Getopt::Long;
2424
use POSIX;
2525

26-
# do not show smartmatch warnings on older perl versions
27-
no if $] >= 5.017011, warnings => 'experimental::smartmatch';
28-
2926
my $verbose = undef;
3027
my $debug = undef;
3128
my $trace = undef;
@@ -472,10 +469,8 @@ sub calc_interface_health {
472469
my ($strCheckLIFStatus, $strCheckLIFHomeNode, $strCheckLIFHomePort) = (1) x 3;
473470
if (defined $strSuboption) {
474471
$strCheckLIFStatus = $strCheckLIFHomeNode = $strCheckLIFHomePort = 0;
475-
my @arySuboption = split(",",$strSuboption);
476-
if ("status" ~~ @arySuboption) { $strCheckLIFStatus = 1; }
477-
if ("home-node" ~~ @arySuboption) { $strCheckLIFHomeNode = 1; }
478-
if ("home-port" ~~ @arySuboption) { $strCheckLIFHomePort = 1; }
472+
my %suboptions = map { $_ => 1 } split(",",$strSuboption);
473+
($strCheckLIFStatus, $strCheckLIFHomeNode, $strCheckLIFHomePort) = @suboptions{qw/ status home-node home-port/};
479474
}
480475

481476
foreach my $strInt (keys %$hrefInterfaceInfo) {

0 commit comments

Comments
 (0)