Hi brothers programmers,

Please help me with this problem.

Same ldif adding (from file ldapadd) works perfectly. But I need to do this in perl, BUT this adding don't work.

WHY?

Thank you very much

The ERROR MESSAGE:
failed to add entry: dn: attribute type undefined

PHP Code:
my $ldap;
 
my $result;

 
#ensure the ldap connection is made
 
$_ $ldap Net::LDAP->new('localhost')or die "$@";

 
# ensure the bind is successful
 
$_ $ldap->bind ("cn=manager,dc=$treename,dc=com"password=>"$rootpass");
 print 
$_->error();


 
$result $ldap->add("cn=Manager,dc=$treename,dc=com",
 
attr =>
 [
   
"dn"          => ["dc=$treename ""dc=com"],
   
"dc"          => "$treename",
   
"objectclass" => "dcObject",
   
"objectclass" => "organizationalUnit",
   
"ou"          => "webcent.com"

 
]);
 
$result->code && warn "failed to add entry: "$result->error