From 92d3c54dcba00a7700a7735a202b0d7eca1ccfbf Mon Sep 17 00:00:00 2001 From: root Date: Tue, 15 Apr 2014 18:26:52 +0200 Subject: Replace deprecated Switch with given --- web/nms.gathering.org/smanagement.pl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'web') diff --git a/web/nms.gathering.org/smanagement.pl b/web/nms.gathering.org/smanagement.pl index c01c52d..f9a172c 100755 --- a/web/nms.gathering.org/smanagement.pl +++ b/web/nms.gathering.org/smanagement.pl @@ -1,10 +1,10 @@ #!/usr/bin/perl use warnings; use strict; +use 5.010; use CGI; use DBI; use Data::Dumper; -use Switch; use lib '../../include'; use nms; @@ -164,8 +164,8 @@ EOF print "
\n"; my @switches = (); -switch ($cgi->param('rangetype')) { - case 'all' { +given ($cgi->param('rangetype')) { + when ('all') { print "Sender `".$cgi->param('cmd')."` til alle switchene
"; @switches = (); $all_switches->execute(); @@ -173,20 +173,20 @@ switch ($cgi->param('rangetype')) { push @switches, $ref->{'sysname'}; } } - case 'switch' { + when ('switch') { # print "Sender `".$cgi->param('cmd')."` til switchene `" # .$cgi->param('range')."`.
"; $_ = $cgi->param('range'); @switches = parse_range($_); } - case 'regexp' { + when ('regexp') { @switches = (); $all_switches->execute(); while (my $ref = $all_switches->fetchrow_hashref) { push @switches, $ref->{'sysname'} if $ref->{'sysname'} =~ $cgi->param('regexp'); } } - case 'row' { + when ('row') { # print "Sender `".$cgi->param('cmd')."` til radene `" # .$cgi->param('range')."`.
"; # print "This function does not work yet."; @@ -195,7 +195,7 @@ switch ($cgi->param('rangetype')) { # @switches = (); print "Slått av!\n"; } -} +}; my $gid; if (@switches > 0) { -- cgit v1.2.3