Net::LD...erMatch(3)
π NAME π
okay bestie, welcome to the Net::LDAP::FilterMatch(3) page β the header truncates it to Net::LD...erMatch(3) because terminal width is dramatic, but the module is Net::LDAP::FilterMatch, and it does LDAP entry matching. That's the whole vibe. β¨
β¨ SYNOPSIS β¨
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 (
'cn' => 'dummy entry',
'street' => [ '1 some road','nowhere' ] );
my @filters = (qw/(cn=dummy*)
(ou=*)
(&(cn=dummy*)(street=*road))
(&(cn=dummy*)(!(street=nowhere)))/);
for (@filters) {
my $filter = Net::LDAP::Filter->new($_);
print $_,' : ', $filter->match($entry) ? 'match' : 'no match' ,"\n";
}
π§ ABSTRACT π§
This extension of the class Net::LDAP::Filter provides entry matching functionality on the Perl side. Slay. π
Give it an entry and it will tell you whether the entry matches the filter object. That's literally the job.
It can be used on its own, or as part of a Net::LDAP::Server based LDAP server. Versatile icon behavior. π¦
π METHOD π
π― 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.
In case of error, undef is returned. Not a slay, but important to know. π
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:
String::ApproxText::MetaphoneText::Soundex
If none of these modules is found, it will fall back on a simple regexp algorithm. Backup plan energy. π«Ά
If you want to specifically use one implementation only, simply do:
use Net::LDAP::FilterMatch qw(Text::Soundex);
π₯ SEE ALSO π₯
Net::LDAP::Filter
π COPYRIGHT π
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
π AUTHORS π
- Hans Klunder
<hans.klunder@bigfoot.com> - Peter Marschall
<peter@adpm.de>
mwah π this was the Net::LD...erMatch(3) page, from perl v5.42.0, dated 2024-01-02. periodt. ππ
π¦ where this page comes from
- opensuse-leap 16.0: perl-ldap 0.68-160000.2.2 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms