return unless defined($arg) and not (ref($arg) eq 'ARRAY' and !@$arg);
- return $arg if ref($arg) eq 'HASH' and ($arg->{-op}||[''])->[0] eq ',';
+ return $self->_expand_maybe_list_expr($arg)
+ if ref($arg) eq 'HASH' and ($arg->{-op}||[''])->[0] eq ',';
my $expander = sub {
my ($self, $dir, $expr) = @_;
sub _expand_maybe_list_expr {
my ($self, $expr, $default) = @_;
- return $expr if ref($expr) eq 'HASH' and ($expr->{-op}||[''])->[0] eq ',';
+ return { -op => [
+ ',', map $self->expand_expr($_, $default),
+ @{$expr->{-op}}[1..$#{$expr->{-op}}]
+ ] } if ref($expr) eq 'HASH' and ($expr->{-op}||[''])->[0] eq ',';
return +{ -op => [ ',',
map $self->expand_expr($_, $default),
ref($expr) eq 'ARRAY' ? @$expr : $expr