in reply to Managing Dynamic SQL

I would second moving over to Class::DBI and using SQL::Abstract. In addition, check out SQL::Interpolate--very cool.
use SQL::Interpolate qw(:all); my($sql, @bind) = sql_interp q[SELECT * FROM mytable WHERE ], {'time' => $time, 'date' => $date}; # Result: # $sql = "SELECT * from mytable where time=? and date=?" # @bind = ($time, $date); my $sth = $dbh->prepare($sql); $sth->execute(@bind);
Also, you might look into the related DBIx::Interpolate.
Hope this helps.
Sean