in reply to Perl and mysql connections

Coming at it from the perl angle, run your script under DProf:

perl -d:DProf script.pl

and then use dprofpp to see which perl subroutine is causing the delay. From that you may be able to figure out where the problem lies.

See Devel::DProf for more details.

dave hj~