diff options
author | David Phillips <david@sighup.nz> | 2018-09-24 21:11:59 +1200 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2018-09-24 21:22:54 +1200 |
commit | 368c962f722853ee0ba371d37e5ba0396e83b900 (patch) | |
tree | d4695371701c57a820364c871bf52a1354442efc /Plugin | |
parent | d77856c7e0ad3f00fd5d6a21b454511081815c21 (diff) | |
download | idalius-368c962f722853ee0ba371d37e5ba0396e83b900.tar.xz |
Remove magic positioning from parse_list and friends
Diffstat (limited to 'Plugin')
-rw-r--r-- | Plugin/Map.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Plugin/Map.pm b/Plugin/Map.pm index 3401f0f..c8708e2 100644 --- a/Plugin/Map.pm +++ b/Plugin/Map.pm @@ -24,10 +24,10 @@ sub map { return "Syntax: map command [item1, item2, ...]" unless $command and $subjects_raw; - my ($e, $from, $to, @subjects) = ListParser::parse_list($subjects_raw); - return $e if $e; + my $parsed = ListParser::parse_list($subjects_raw); + return $parsed->{error} if $parsed->{error}; - my @results = map { $run_command->("$command $_", $who, $where, $ided) } @subjects; + my @results = map { $run_command->("$command $_", $who, $where, $ided) } @{$parsed->{array}}; return "[" . (join ", ", @results). "]"; } 1; |