- $_ = ref $_ eq 'HASH' ? {%$_} : {value => $_} for @$value;
- $_->{label} = ref $label eq 'ARRAY' ? shift @$label : $label for @$value;
+ $rows = [ map { ref $_ eq 'HASH' ? {%$_} : {value => $_} } @$rows ];
+ if (ref $label eq 'ARRAY') {
+ $rows->[$_]->{label} = $label->[$_] for 0 .. $#$rows;
+ } else {
+ $_->{label} = $label for @$rows;
+ }