From: Chris R. <chr...@ma...> - 2002-12-06 09:24:10
|
On 6/12/02 8:18 am, Eric Santonacci <Eri...@ta...> wrote: > Hello list, > > I'm quite new with Net::LDAP module and I have a question about > ldapsearch. > > I have the following perl code: > > > $mesg = $ldap->search ( # perform a search > base => "ou=people, o=test, c=net", > filter => "uid=$uid" > ); > > > When the $uid is in LDAP database everything is fine, if $uid is not in > LDAP, $mesg->code returns 0 (means "success"). But it couldn't find any > answer. Is that a normal answer for LDAP? I expected to have an answer > like "Not Found". Currently, I need to check $entry->get_value to see if > I have an error or not to ensure ldapsearch found or not a record. That's correct - searches can succeed but return no results. You can call $mesg->count() to find out how many results you got back - see the Net::LDAP::Search man page. Cheers, Chris |