use warnings; use strict; use Statements; # Internal Module use DBI; require DBD::ODBC; my $dbh = DBI->connect('DBI:ODBC:goober') or die "Unable to connect to Goober"; #Use NT Auth $dbh->{PrintError} = 0; $dbh->{AutoCommit} = 0; $dbh->{RaiseError} = 1; # We don't pass these to connect, because SQL Server seems to # randomly ignore them unless we do as above. my $sth; eval { $sth = $dbh->prepare( $QUERY{auth} ) }; if ($@) { die "Could not prepare $QUERY{auth}: $DBI::errstr ($@)"; } while (my $row = $sth->fetchrow_hashref) { #do things... }