title: Perl Net::LDAP filter not working
body: <p>I'm using perl-ldap to search and modify LDAP directories.</p>
  
  <p>Everything works fine except for when I try to search a group based on its "uniqueMember" attribute, whose value is a dn (e.g., <code>cn=exuser,ou=people,dc=example,dc=com</code>). </p>
  
  <p>This would seem to make the filter string for a search based on a group member </p>
  
  <pre><code>uniqueMember=cn=exuser,ou=people,dc=example,dc=com
  </code></pre>
  
  <p>But that doesn't work.</p>
  
  <p>Neither does "escaping" the equals in the string, so that the resultant string when printed looks like it has its equals signs escaped. And the Net::LDAP::Filter object doesn't have great documentation, so I'm not sure how to create one besides just passing the filter strings I've been using in the first place (which also doesn't work).</p>
  
  <p>Any suggestions?</p>
  
  <p>I should add that I'm certain the problem is with the search not returning results - the resulting Search object has 0 count.</p>
  
  <p>I can't show the exact code, but it is something like this (only literals have been changed):</p>
  
  <pre><code>my $filter = "uniqueMember=cn=exuser,ou=people,dc=example,dc=com";
  
  my $result = $ldap-&gt;search( base =&gt; 'ou=groups,dc=example,dc=com',
                              filter =&gt; $filter);
  while(my $entry = $result-&gt;pop_entry)
  { ....
  ....
  }
  </code></pre>
  
  <p>Connection and binding to the LDAP server has been done in a subroutine, which works. I'm certain about the names of the organizational unit as  well as the format of the <code>uniqueMember</code> values. For the <code>$filter</code> string, I have tried escaping the equals signs once (<code>\=</code>) and twice (<code>\\\\=</code>). I have tried using <code>Net::LDAP::Filter-&gt;new($filter)</code> - although my understanding is that it takes a filter string like the one in the code, so this hasn't been very helpful.</p>
  
  <p>What is the correct way to format this filter string?</p>