From 7ba80c0dfe298f7b9ed860a74d104b83f192fc8c Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Sun, 19 Nov 2017 12:50:58 +0100 Subject: [PATCH] Define actions array before the loop --- scripts/patrix | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/scripts/patrix b/scripts/patrix index 669feef..01b12ce 100644 --- a/scripts/patrix +++ b/scripts/patrix @@ -59,9 +59,19 @@ if ($opt->{conf} && -e $opt->{conf}){ } # alias for --action=foo is --foo -foreach my $action (qw(send-msg send-notice send-file create-room modify-room - delete-room-alias get-access-token get-room-list get-room-id - setup)){ +my @actions = qw( + send-msg + send-notice + send-file + create-room + modify-room + delete-room-alias + get-access-token + get-room-list + get-room-id + setup +); +foreach my $action (@actions){ if ($opt->{$action}){ $opt->{action} = $action; last;