tcf03 has asked for the wisdom of the Perl Monks concerning the following question:
basically I just want to test for the existance of a database. My question though is even as $dbh goes out of scope is it necessarily cleanly closing the connection? Or does it even matter, since Im doing nothing here other than connecting?DBTEST: { my $dbh=( DBI->connect("DBI:mysql:$filename:server.domain.com:3306", +'dbadmin', 'password') ) ? print "db $filename exists\n" : print "db $filename does not exist\n"; }
DBI connect('billexport:server.domain.com:3306','dbadmin',...) failed: + Unknown database 'billexport' at ./generatefiles.pl line 21
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: db connections and scope
by ikegami (Patriarch) on Sep 16, 2005 at 17:02 UTC |