loosifer has asked for the wisdom of the Perl Monks concerning the following question:
I'm writing a number of scripts which hit LDAP databases, and I want to prefer but not require SSL in my LDAP connections. In simple cases, eval { require Net::LDAPS; } works, but if the Net::LDAPS module exists but does not compile, the eval still returns correctly.
For instance, say the IO::Socket::SSL library is missing, or the libssl library is missing, but Net::LDAPS is there. In that case, the eval returns correctly but any attempt to actually use Net::LDAPS fails miserably.
How can I test for existence and success of a module?
I know the correct solution is to not have Net::LDAPS unless it works correctly, but that doesn't really solve the original problem. Or rather, the real correct solution is to use start_tls on Net::LDAP, but the server I'm using (Netscape 4.x) doesn't support TLS...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Testing sub-module existence
by broquaint (Abbot) on May 07, 2002 at 16:18 UTC | |
by loosifer (Novice) on May 07, 2002 at 19:10 UTC | |
|
Re: Testing sub-module existence
by samtregar (Abbot) on May 07, 2002 at 18:36 UTC |