Understaing NET::LDAP

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I have a LDAP query like:

    my $basedn = "ou=people,o=myhost.com";
    my $scope = "sub";
    my $filter = "manager=uid=fred,ou=people,o=myhost.com";

    $searchobj = $conn->search( base=>$basedn, scope=>$scope,
filter=>$filter, attrs=>$attrs );

    my $max = $searchobj->count;

    ## iterate through the hash
    for($i = 0 ; $i < $max ; $i++)
        my $entry = $searchobj->entry($i);
        foreach my $attr ($entry->attributes)
            #iterate over the fields

Only thing is that I'd like to limit the records being returned.

The object "manager" could look like either

So .... since I am searching for "uid=fred,ou=people,o=myhost.com" I get
both rows.

I can limit the output in the "foreach" step, but I'd like to limit the
number of records matching the search in the filter so the script
processes quicker.

Anyone have any idea how to enhance the filter further?


Site Timeline