in reply to How do I specify the MySQL socket file?

This will not answer your questions about sock, but what is wrong with trying to connect to MySQL with:
$dbconnect='DBI:mysql:database=NameOfDatabase; host=NameOfHost; user=U +ser; password=PassWord'; $databasehandle=DBI->connect($dbconnect);
In real life you will want to check the return value of the connect-method.

CountZero

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