sub Do_SQL{ my ( $command )=@_; my $sth; eval{ $sth = $dbh->prepare($command); }; # Check for errors. if ($@){ $dbh->disconnect; print "Content-type: text/html\n\n"; print "An ERROR occurred! $@\n"; exit; } else { $sth->execute; } return $sth; }