When I switched my perl environment from 5.16.0 to 5.24.0 I got a strange behavior that I cannot understand. This code
use DBI;
my $conn = 'dbi:ODBC:sqlserver_xxxx';
my $userid = 'dw_select';
my $passwd = 'xxxx';
for ( 1 .. 100 ) {
warn "start try $_";
my $dbh = DBI->connect($conn, $userid, $passwd, { RaiseError => 1 } );
warn "end try $_";
}
runs fine on 5.16.0 but when switched to 5.24.0 I got following result:
start try 1 at test_con.pl line 9.
end try 1 at test_con.pl line 11.
start try 2 at test_con.pl line 9.
end try 2 at test_con.pl line 11.
start try 3 at test_con.pl line 9.
DBI connect('sqlserver_xxxx','dw_select',...) failed:
Unable to fetch information about the error at test_con.pl line 10.
with this modification it runs without errors again:
use DBI;
my $conn = 'dbi:ODBC:sqlserver_xxxx';
my $userid = 'dw_select';
my $passwd = 'xxxx';
my $dbh;
for ( 1 .. 100 ) {
warn "start try $_";
$dbh = DBI->connect($conn, $userid, $passwd, { RaiseError => 1 } );
warn "end try $_";
}
Does anyone of you have an explanation for that?
perl -MDBI -E"say $DBI::VERSION"
on Perl v 5.24? – Giacometti$dbh->disconnect();
will help? – Sherronsherry