use SQL::Interpolate (qw/sql_interp/); my ($sql,@bind) = sql_interp( " city == ",\$city," AND (sale == 1 OR rent == 1)" );