From: Graham B. <gb...@po...> - 2000-06-12 10:04:40
|
My ISP has been having mail trouble, so I am behind on mail. I am only able to reply to this because I downloaded the mbox from www.xray.mpe.mpg.de On Fri, Jun 09, 2000 at 08:46:43AM +0100, Chris Ridd wrote: > 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. Actually they will both work. > 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. There should be no case in which it will return undef. It should always return a Message object. If there were local errors Net::LDAP will set the error code in the object. Graham. |