From: Chris R. <Chr...@me...> - 2000-06-09 07:50:29
|
On Thu, 08 Jun 2000 22:18:26 CDT, Mark Wilcox wrote: > No that's not true (or at least shouldn't be, I haven't tested this in > Net::LDAP v .19 to make sure it wasn't broken). You should get error code > 49. > How are you checking, this is how the code should look: > my $mesg = $ldap->bind($dn, password=>"password"); > > die ("failed to bind ",$mesg->code(),"\n") if $mesg->code(); > > mark You should use 'dn => $dn' instead of just a plain $dn, I think. One additional point to note is that the following: my $mesg = $ldap->bind(dn => $dn, password=>"password") or die; does *not* call 'die' if the server rejects the bind. It only calls 'die' if something nasty has happened inside Net::LDAP, which is not the same thing at all. Graham, would it be more sensible for Net::LDAP to just call die itself instead of returning undef on failure? It would mean clients would have to wrap more calls inside eval { } but I'm not sure that's a bad thing. Cheers, Chris |