On 27/9/06 5:21, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I am writing a simple search script using Net::LDAP. The problem that I
> am having is with the filter.
>
> When I execute my script I get the following error message: "Bad filter at
> line 15".
>
> The attribute that I am use a part of the filter is "employeetype" and the
> value is "consultant (pre-release)". This is a legitimate value.
But it is not legitimate as-is in a search filter, because parentheses are
syntactically special in the string representations of these.
RFC 4515 says you need to replace ( in a filter value with \28 and ) with
\29. As you're writing a perl double-quoted string, you'll need to escape
those backslashes and thus you should end up writing:
filter => "(employeetype=consultant \\28pre-release\\29)"
I think there's a note in the Net::LDAP::Filter docs about this escape
mechanism. If not, there should be.
Cheers,
Chris