I have code that is working - I can connect fine using Net::LDAP->new ( "ldaps://abc.def.com", port => 636, version => 3, timeout=>5 );, however, one time there was something wrong with the server and the connection attempt continued indefinitely, whereas I expected it to timeout after 5 seconds. I can reproduce this by changing ldaps to ldap - hense there is a port there but there should be no connection because of the different protocol. Any ideas ?