in reply to Perl and mysql connections

However, as soon as I move the mysql server to another machine it takes at least 30 seconds - sometimes minutes.

In my experience nearly all problems like "connecting to service X is very slow" are caused by DNS misconfiguration. I bet that MySQL service is configured to resolve client IP and DNS server it uses for DNS lookups cannot resolve this IP. So MySQL server had to wait for DNS query timeout. Solution: either disable DNS lookups in mysql or fix DNS.

--
Ilya Martynov, ilya@iponweb.net
CTO IPonWEB (UK) Ltd
Quality Perl Programming and Unix Support UK managed @ offshore prices - http://www.iponweb.net
Personal website - http://martynov.org