Код аутентификации
# Authentication Code
use strict;
use Net::LDAP;
my $dc = ?dc1?;
my $user = ?cn=administrator, cn=users, dc=mycorp, dc=com?;
my $passwd = ?Adminpasswd?;
my $ldap = Net::LDAP->new($dc) or die $@;
my $rc = $ldap->bind( $user, password => $passwd);
die $rc->error if $rc->code;

$ldap->unbind;