#!/bin/perl -w
use strict;
use DBI;
use Net::LDAP qw(:all);
my $ldap = Net::LDAP->new("localhost") or die "$@";
my $mesg;
$mesg = $ldap->bind("cn=admin,dc=local,dc=net",password=>'xxxx',version=>3);
my $DNbranch = "ou=People,dc=local,dc=net";
my $CreateArray = [
objectClass => ["top", "person", "inetOrgPerson"],
cn => "Markus Rechberger test",
sn => "Markus",
mail => "mare\@gemail.net"
];
my $NewDN = "@$CreateArray[2]=".
"@$CreateArray[3],".
$DNbranch;
print $NewDN."\n";
my $result = $ldap-> add ($NewDN, attrs=> [ @$CreateArray ]); |