+ if (my $acount = scalar(@$args)) {
+ if ($list_param) {
+ $opts->{$list_param} = $args;
+ $args = [];
+ } elsif (ref($arg_param)) {
+ raise("wrong number of arguments\n", code => HTTP_BAD_REQUEST)
+ if scalar(@$arg_param) != $acount;
+ foreach my $p (@$arg_param) {
+ $opts->{$p} = shift @$args;
+ }
+ } else {
+ raise("too many arguments\n", code => HTTP_BAD_REQUEST)
+ if scalar(@$args) != 0;
+ }