1Net::LDAP::FilterMatch(U3s)er Contributed Perl DocumentatNieotn::LDAP::FilterMatch(3)
2
3
4
6 Net::LDAP::FilterMatch - LDAP entry matching
7
9 use Net::LDAP::Entry;
10 use Net::LDAP::Filter;
11 use Net::LDAP::FilterMatch;
12
13 my $entry = new Net::LDAP::Entry;
14 $entry->dn("cn=dummy entry");
15 $entry->add (
16 'cn' => 'dummy entry',
17 'street' => [ '1 some road','nowhere' ] );
18
19 my @filters = (qw/(cn=dummy*)
20 (ou=*)
21 (&(cn=dummy*)(street=*road))
22 (&(cn=dummy*)(!(street=nowhere)))/);
23
24 for (@filters) {
25 my $filter = Net::LDAP::Filter->new($_);
26 print $_,' : ', $filter->match($entry) ? 'match' : 'no match' ,"\n";
27 }
28
30 This extension of the class Net::LDAP::Filter provides entry matching
31 functionality on the Perl side.
32
33 Given an entry it will tell whether the entry matches the filter
34 object.
35
36 It can be used on its own or as part of a Net::LDAP::Server based LDAP
37 server.
38
40 match ( ENTRY [ ,SCHEMA ] )
41 Return whether ENTRY matches the filter object. If a schema object
42 is provided, the selection of matching algorithms will be derived
43 from schema.
44
45 In case of error undef is returned.
46
47 For approximate matching like (cn~=Schmidt) there are several modules
48 that can be used. By default the following modules will be tried in
49 this order:
50
51 String::Approx
52 Text::Metaphone
53 Text::Soundex
54
55 If none of these modules is found it will fall back on a simple regexp
56 algorithm.
57
58 If you want to specifically use one implementation only, simply do
59
60 use Net::LDAP::FilterMatch qw(Text::Soundex);
61
63 Net::LDAP::Filter
64
66 This library is free software; you can redistribute it and/or modify it
67 under the same terms as Perl itself.
68
70 Hans Klunder <hans.klunder@bigfoot.com> Peter Marschall <peter@adpm.de>
71
72
73
74perl v5.8.8 2007-02-10 Net::LDAP::FilterMatch(3)