When I switched perl environment from 5.16.0 to 5.24.0, I got strange behavior that I can not 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 $_";
}
working fine on 5.16.0, but when switching to 5.24.0 I got the 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 starts again without errors:
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 $_";
}
Do any of you have an explanation?
source
share