#!/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" ];

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

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

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

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

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