in reply to Re^2: DBI connect problems
in thread DBI connect problems
Please, next time use <code> tags to embed code in your posts, I had to reformat all the code to be able to read it.
I see that you use DBI inside the first sub, and this is unnecessary for you have already used it before.
I see also that you don't use strictures and this is bad.
use strict; use warnings;
are your friends.
I don't know why the second call returns an error, as I said before best practice is to connect to db once at the beginning and disconnect at the end of the script. If you want to connect/disconnect in every sub, try adding strictures, add the global part of your code (the calls to the subs), execute it and see which error(s) results
After this, post again the "complete" code (the minimal code that can be executed giving the error) AND the resulting error (sorry, I can't test it because I don't have mysql installed on my machine)
Careful with that hash Eugene.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: DBI connect problems
by Anonymous Monk on Jun 12, 2008 at 19:11 UTC |