my $sql = $a; ... $sql .= " where ".join(" and ", @where) if @where;