$condition{$key} = \@{$query->param($key)} || $condition{$key} = $query->param($key); #### $condition{$key} = [$query->param($key)]; #### if (@{$condition{$key}} == 1) { # one value } else { # ... zero or more than one value }