.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Net::LDAP::FilterMatch 3" .TH Net::LDAP::FilterMatch 3 2024-09-01 "perl v5.40.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Net::LDAP::FilterMatch \- LDAP entry matching .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 3 \& use Net::LDAP::Entry; \& use Net::LDAP::Filter; \& use Net::LDAP::FilterMatch; \& \& my $entry = new Net::LDAP::Entry; \& $entry\->dn("cn=dummy entry"); \& $entry\->add ( \& \*(Aqcn\*(Aq => \*(Aqdummy entry\*(Aq, \& \*(Aqstreet\*(Aq => [ \*(Aq1 some road\*(Aq,\*(Aqnowhere\*(Aq ] ); \& \& my @filters = (qw/(cn=dummy*) \& (ou=*) \& (&(cn=dummy*)(street=*road)) \& (&(cn=dummy*)(!(street=nowhere)))/); \& \& \& for (@filters) { \& my $filter = Net::LDAP::Filter\->new($_); \& print $_,\*(Aq : \*(Aq, $filter\->match($entry) ? \*(Aqmatch\*(Aq : \*(Aqno match\*(Aq ,"\en"; \& } .Ve .SH ABSTRACT .IX Header "ABSTRACT" This extension of the class Net::LDAP::Filter provides entry matching functionality on the Perl side. .PP Given an entry it will tell whether the entry matches the filter object. .PP It can be used on its own or as part of a Net::LDAP::Server based LDAP server. .SH METHOD .IX Header "METHOD" .IP "match ( ENTRY [ ,SCHEMA ] )" 4 .IX Item "match ( ENTRY [ ,SCHEMA ] )" Return whether ENTRY matches the filter object. If a schema object is provided, the selection of matching algorithms will be derived from schema. .Sp In case of error undef is returned. .PP For approximate matching like (cn~=Schmidt) there are several modules that can be used. By default the following modules will be tried in this order: .PP .Vb 3 \& String::Approx \& Text::Metaphone \& Text::Soundex .Ve .PP If none of these modules is found it will fall back on a simple regexp algorithm. .PP If you want to specifically use one implementation only, simply do .PP .Vb 1 \& use Net::LDAP::FilterMatch qw(Text::Soundex); .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" Net::LDAP::Filter .SH COPYRIGHT .IX Header "COPYRIGHT" This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH AUTHORS .IX Header "AUTHORS" Hans Klunder Peter Marschall