Skip to content
Snippets Groups Projects
Commit b7a21675 authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

drop usage of experimental switch feature

parent 960669b1
Branches
Tags
No related merge requests found
......@@ -4,8 +4,6 @@ use strict;
use warnings;
use utf8;
use lib qw(@modulesdir@);
use feature "switch";
no if $] >= 5.017011, warnings => 'experimental::smartmatch';
use Config::Tiny;
use Data::Dumper;
......@@ -62,21 +60,19 @@ AccountManager::DB->register_db(
my $db = AccountManager::DB->new();
for ($action) {
when ('add_account') { add_account() }
when ('list_accounts') { list_accounts() }
when ('add_service') { add_service() }
when ('list_services') { list_services() }
when ('add_token') { add_token() }
when ('get_token') { get_token() }
when ('list_tokens') { list_tokens() }
when ('parse_metadata') { parse_metadata() }
default {
pod2usage(
-message => "invalid action '$action', aborting\n",
-verbose => 0
);
}
SWITCH: {
if ($action eq 'add_account') { add_account(); last SWITCH; }
if ($action eq 'list_accounts') { list_account(); last SWITCH; }
if ($action eq 'add_service') { add_service(); last SWITCH; }
if ($action eq 'list_services') { list_services(); last SWITCH; }
if ($action eq 'add_token') { add_token(); last SWITCH; }
if ($action eq 'get_token') { get_token(); last SWITCH; }
if ($action eq 'list_tokens') { list_tokens(); last SWITCH; }
if ($action eq 'parse_metadata') { parse_metadata(); last SWITCH; }
pod2usage(
-message => "invalid action '$action', aborting\n",
-verbose => 0
);
}
sub add_account {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment