in reply to Perl and mysql connections

Perhaps showing us some code, would enable us to give some more detailed answers.

May we suggest the following:

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law