I am using the Net::LDAP and Net::LDAP::Search objects to retrieve up to 10 entries 
from a LDAP db.  Everything works fine until I try to sort the entries returned in the 
search object.  The entries are sorted, but not by the attributes I specify.  Instead 
they seem to be sorted by the DN.  Does anyone have a clue as to what I am doing 
wrong?  Here are some snippets of the code that I am using:

my $filter = "&(sn=$lname*)";
if ($fname) {$filter .= " (&(givenName=$fname*))"}
$filter = "($filter)";

my $searchresult = $ldap->search( base => $search_base,
                                  filter => $filter,
                                  sizelimit => (11));

my @sort = ($searchresult->sorted(["sn", "givenName"]));

Thanks for any help you can give,
chris h

Reply via email to