my $sql="$a where "; my @where; push @where, $b if $b; push @where, $c if $c; $sql .= join " and ", @where;