in reply to search result on Net LDAP

There are no entries (count = 0), so why would you expect to get an entry from entry()?

By the way, use == (not eq) for numerical comparisons.