$form{col} = [ qw(NEW PND CLS) ]; my $query_arg = join(" or ", "table.column=?" x @$form{col}); # Assuming you have main query $query_str .= $query_arg if $query_arg; ... $sth->execute(@$form{col});