# Net::LDAP::FilterMatch - LDAP entry matching - perldoc - [phpMan]

## NAME
    [Net::LDAP::FilterMatch](https://www.chedong.com/phpMan.php/perldoc/Net%3A%3ALDAP%3A%3AFilterMatch/markdown) - LDAP entry matching

## SYNOPSIS
      use [Net::LDAP::Entry](https://www.chedong.com/phpMan.php/perldoc/Net%3A%3ALDAP%3A%3AEntry/markdown);
      use [Net::LDAP::Filter](https://www.chedong.com/phpMan.php/perldoc/Net%3A%3ALDAP%3A%3AFilter/markdown);
      use [Net::LDAP::FilterMatch](https://www.chedong.com/phpMan.php/perldoc/Net%3A%3ALDAP%3A%3AFilterMatch/markdown);

      my $entry = new [Net::LDAP::Entry](https://www.chedong.com/phpMan.php/perldoc/Net%3A%3ALDAP%3A%3AEntry/markdown);
      $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](https://www.chedong.com/phpMan.php/perldoc/Net%3A%3ALDAP%3A%3AFilter/markdown)->new($_);
        print $_,' : ', $filter->match($entry) ? 'match' : 'no match' ,"\n";
      }

## ABSTRACT
    This extension of the class [Net::LDAP::Filter](https://www.chedong.com/phpMan.php/perldoc/Net%3A%3ALDAP%3A%3AFilter/markdown) provides entry matching functionality on the Perl
    side.

    Given an entry it will tell whether the entry matches the filter object.

    It can be used on its own or as part of a [Net::LDAP::Server](https://www.chedong.com/phpMan.php/perldoc/Net%3A%3ALDAP%3A%3AServer/markdown) based LDAP server.

## 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.

    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::Approx](https://www.chedong.com/phpMan.php/perldoc/String%3A%3AApprox/markdown)
      [Text::Metaphone](https://www.chedong.com/phpMan.php/perldoc/Text%3A%3AMetaphone/markdown)
      [Text::Soundex](https://www.chedong.com/phpMan.php/perldoc/Text%3A%3ASoundex/markdown)

    If none of these modules is found it will fall back on a simple regexp algorithm.

    If you want to specifically use one implementation only, simply do

      use [Net::LDAP::FilterMatch](https://www.chedong.com/phpMan.php/perldoc/Net%3A%3ALDAP%3A%3AFilterMatch/markdown) qw([Text::Soundex](https://www.chedong.com/phpMan.php/perldoc/Text%3A%3ASoundex/markdown));

## SEE ALSO
    [Net::LDAP::Filter](https://www.chedong.com/phpMan.php/perldoc/Net%3A%3ALDAP%3A%3AFilter/markdown)

## 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>>

