{ my $rev_types = { both => [qw/rev theater_avg num_theaters/], total => [qw/rev num_theaters/], loc_avg => [qw/ theater_avg num_theaters/], all => [qw/rev theater_avg num_theaters day_multiple/], }; sub _rev_types { my $key = @_ ? shift : 'both'; exists $rev_type->{$key}? @{$rev_types->{$key}} : @{$rev_types->{'both'}}; } } sub _select_fields { my $self = shift; return _rev_types( $self->request->param('rev_type')); }