use Net::LDAPS; use Net::LDAP; $ldaps = Net::LDAPS->new( $strLDAPIpAdd,port =>$strLDAPPort,onerror=>undef); if ($ldaps==undef) { print("Ip Address of LDAP server over SSL is not correct"); return $ERROR; } $mesg = $ldaps->bind(); if ($mesg->code==0) { print ("LDAP over SSL with ip $strLDAPIpAdd connected successfully!"); $mesg=$ldaps->unbind; } else{ print("LDAP over SSL with ip $strLDAPIpAdd not connected..."); $mesg=$ldaps->unbind; }