dba has asked for the wisdom of the Perl Monks concerning the following question:

I loop through a list of databases to query. When I mix   $dbh = DBI->connect($tns,$uid,$pswd,{ ora_session_mode =>2}) with  DBI->connect($tns,$uid,$pswd), (based on the database) perl crashes at the end of the program. However, if I use only one way to connect, it exits normally. Any one used this, or have any suggestions to fix this error ?