> On 13 Jun 2015, at 12:30, Natxo Asenjo <natxo.ase...@gmail.com> wrote: > > > > On Sat, Jun 13, 2015 at 11:47 AM, Chris Ridd <chrisr...@mac.com> wrote: > > > On 11 Jun 2015, at 22:45, David Lee Lambert <dav...@lmert.com> wrote: > > > I've reduced my non-working code to the following... > > > > #! perl -w > > > > use Net::LDAP; > > my $ad = Net::LDAP->new('ad.**org**.com', debug => 2) > > or die "Couldn't connect to AD: $@, $!"; > > $ad->bind('**tried lots of stuff**', password => '**password**') > > or die "Couldn't bind: $@, $!”; > > I think what you’re checking here is a failure to either construct the bind > operation or send the bind to the server. > > But this *isn’t* the right way to check for bind failures. Binds are just > another LDAP operation which returns a result, so you should check the result > message like you do for search further down. > > exactly, and it turns out it is a FAQ ;-) > > http://search.cpan.org/~marschap/perl-ldap-0.65/lib/Net/LDAP/FAQ.pod#How_can_I_tell_when_the_server_returns_an_error,_bind%28%29_always_returns_true?
It is quite a common mistake though. I know the synopsis in the main doc takes care to show bind returning a $mesg, but it never does anything with it. Perhaps that’s wrong. While I’m looking at the man page, I see references still to bigfoot.com and umich.edu! Maybe they should be replaced with something less obsolete - such as example.com. Chris