This should help you, just check return code from connect(): (Tested and worked, I have web, but not weeb)
use DBI; use strict; use warnings; my $dbi; my @databases = ('dbi:ODBC:weeb', 'dbi:ODBC:web'); for (@databases) { print "attempt connect to database $_\n"; if ($dbi = DBI->connect($_,"","",{AutoCommit=>1})) { print "connected to database $_\n"; last; } }
In reply to Re: Perl DBI Question
by pg
in thread Perl DBI Question
by yoda54
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |