in reply to generating various sql arguments dynamically, and on crack

Name all the fields with the same name, then just join an array of (valid) values. Oh yeah, and use placeholders (here's a rough sketch):
$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});