use SQL::Interpolate qw(sql_interp); my($sql, @bind) = sql_interp q{INSERT INTO logs}, ["", $typ, $time, $date, $severity, $action, $ip, $line]; $dbh->prepare($sql); $dbh->execute(@bind);