my $sql = "INSERT INTO $table VALUES ...."; print STDERR "About to execute the sql statement $sql\n" if $debug; my $sth = prepare($sql); ...etc...