1Net::LDAP::Filter(3) User Contributed Perl Documentation Net::LDAP::Filter(3)
2
3
4
6 Net::LDAP::Filter - representation of LDAP filters
7
9 use Net::LDAP::Filter;
10
11 $filter = Net::LDAP::Filter->new( $filter_str );
12
14 The Net::LDAP::Filter object lets you directly manipulate LDAP filters
15 without worrying about the string representation and all the associated
16 escaping mechanisms.
17
19 new ( [ FILTER ] )
20 Create a new object. If FILTER is given, parse it.
21
23 parse ( FILTER )
24 Parse FILTER, updating the object to represent it. The next call
25 to ber will return this filter encoded.
26
27 as_string
28 Return the filter in text form.
29
30 print ( [ FH ] )
31 Print the text representation of the filter to FH, or the currently
32 selected output handle if FH is not given.
33
34 negate ( )
35 Logically negate/invert the filter object so that it matches the
36 opposite set of entries as the original.
37
38 Instead of simply negating the text form by surrounding it with the
39 not operator, the negation is done by recursively applying De
40 Morgan's law.
41
42 Here is an example:
43
44 (|(&(cn=A)(cn=B))(|(!(cn=C))(cn=D)))
45
46 gets negated to
47
48 (&(|(!(cn=A))(!(cn=B)))(&(cn=C)(!(cn=D))))
49
51 Below is the syntax for a filter given in RFC 4515
52 http://www.ietf.org/rfc/rfc4515.txt
53
54 filter = "(" filtercomp ")"
55 filtercomp = and / or / not / item
56 and = "&" filterlist
57 or = "|" filterlist
58 not = "!" filter
59 filterlist = 1*filter
60 item = simple / present / substring / extensible
61 simple = attr filtertype value
62 filtertype = equal / approx / greater / less
63 equal = "="
64 approx = "~="
65 greater = ">="
66 less = "<="
67 extensible = attr [":dn"] [":" matchingrule] ":=" value
68 / [":dn"] ":" matchingrule ":=" value
69 present = attr "=*"
70 substring = attr "=" [initial] any [final]
71 initial = value
72 any = "*" *(value "*")
73 final = value
74 attr = AttributeDescription from Section 4.1.4 of RFC 4511
75 matchingrule = MatchingRuleId from Section 4.1.8 of RFC 4511
76 value = AttributeValue from Section 4.1.5 of RFC 4511
77
78
79 Special Character encodings
80 ---------------------------
81 * \2a, \*
82 ( \28, \(
83 ) \29, \)
84 \ \5c, \\
85 NUL \00
86
88 Net::LDAP, Other online documentation
89
91 This document is based on a document originally written by Russell
92 Fulton <r.fulton@auckland.ac.nz>.
93
95 Graham Barr <gbarr@pobox.com>
96
97 Please report any bugs, or post any suggestions, to the perl-ldap
98 mailing list <perl-ldap@perl.org>.
99
101 Copyright (c) 1997-2004 Graham Barr. All rights reserved. This program
102 is free software; you can redistribute it and/or modify it under the
103 same terms as Perl itself.
104
105
106
107perl v5.16.3 2018-10-30 Net::LDAP::Filter(3)