Another prepare_cached() example
Handy for dynamically constructed statements:
while ( ($field, $value) = each %search_fields ) {
push @sql, "$field = ?";
push @values, $value;
}
$where = "";
$where = "where ".join(" and ", @sql) if @sql;
$sth = $dbh->prepare_cached("select * from table $where");
$sth->execute(@values);