#!/usr/bin/perl

use Mozilla::LDAP::Conn;
use Mozilla::LDAP::Entry;

$entry = new Mozilla::LDAP::Entry();
$entry->setDN("uid=tuser,dc=example,dc=com");
$entry->{objectclass} = [ "top", "person", "inetOrgPerson" ];
$entry->{cn} = [ "test user0" ];

print "---- Starting with this entry ----\n";
$entry->printLDIF();

$key =  $entry->FIRSTKEY();
print "First Key is: $key\n";

print "Deleting cn attribute values\n\n";
$entry->remove("cn");

print "---- Updated entry ----\n";
$entry->printLDIF();

$key =  $entry->FIRSTKEY();
print "First Key is now: $key\n";

