my $DEBUG = 1; # comment out when not debugging my $sql = "INSERT INTO foo (first_col,second_col) VALUES (?,?)"; my @params = ($string,$number); print "$sql\n[@params]\n" if $DEBUG; my $sth = $dbh->prepare( $sql ); $sth->execute( @params );