On 28/9/06 10:43, Alexander Foken <[EMAIL PROTECTED]> wrote:

> And a second note: I would prefer to have a placeholder mechanism like
> in DBI, so I don't have to care about escaping strings. Something like
> filter => ["(&(employeetype=?)(gender=?))",$type,$gender ]

The sentiment's good, but I think we can do better than that.

The string filter is merely an API detail - in the protocol, filters are
structured ASN.1 things. Compare this with SQL, where everything really *is*
just a string.

So we already have a Net::LDAP::Filter class that can produce an object
which can be passed to 'filter =>'.

Unfortunately, while the docs for Net::LDAP::Filter say you can directly
manipulate filters without worrying about the string representation and all
the associated escaping mechanisms, it provides no way to do this apart from
via a string, and no hints about what the structured filters look like.

Gotcha! :-)

It would be nice if there was a documented interface to Filter to allow a
structured filter to be manipulated. Looking at it in a debugger I'd guess
it is just a hash that's compatible with Convert::ASN1...

Cheers,

Chris


Reply via email to