# #run_sql # subroutine that does all of the work # sub run_sql{ my $sql = shift; my $sth = $dbh->prepare($sql); if (!$sth) { die "Error:" . $dbh->errstr ." while preparing ".$sql."\n"; } if (!$sth->execute) { die "Error:" . $sth->errstr ." while executing ".$sql."\n"; } return $sth; } # run_sql