Net::LDAP::Entry -- An LDAP entry object
use Net::LDAP::Entry; $entry = Net::LDAP::Entry->new; $entry->add( attr1 => 'value1', attr2 => [qw(value1 value2)] ); $entry->delete( 'unwanted' ); $entry->replace( attr1 => 'newvalue' attr2 => [qw(new values)] );
Net::LDAP::Entry is a representation of an entry on an LDAP server. A Net::LDAP::Entry object is typically created as a result of a search on an LDAP server or by reading from an LDIF file with Net::LDAP::LDIF
Net::LDAP::Entry
The constructor for Net::LDAP::Entry does not take any arguments.
Add attribute values to the entry. VALUE may be a reference to an array if multiple values are to be added.
VALUE
Replace all existing values for ATTR with VALUE. VALUE may be a reference to an array of multiple values. If VALUE is a reference to an empty array the the attribute ATTR will be deleted.
ATTR
If just ATTR is specified then then all values for the given attribute will be deleted. If VALUE is given then only the specified value is deleted. VALUE may be a reference to an array of values if more than one value for the same attribute is to be deleted.
If delete is called with no arguments, then the changetype of the entry will be set to delete and a subsequent call to update will cause the entry to be deleted from the server
delete
Get or set the DN for the entry.
DN
update will send the required commands to the server so that any add,replace,delete methods that were performed on the object are replicated on the server. The result depends on the current changetype of the entry.
update
add
replace
An add request will be sent to CLIENT with the current contents of the object.
CLIENT
A modify request will be sent to CLIENT, duplicating any prior add,replace and delete methods that have been called on the object.
A delete request will be sent to the CLIENT with the current DN of the object.
Returns a list of all the know attributes the entry has. This will either be a list of all the attibutes that were requested by a search request or all the attributes that were read from an LDIF file.
Returns a list of values for the attribute ATTR
TYPE may be one of add, modify, delete. Calling without an argument will return the current changetype.
TYPE
modify
The changetype affect what happens when update is called.
Net::LDAP
This document is based on a document originally written by Russell Fulton <r.fulton@auckland.ac.nz>
Graham Barr <gbarr@pobox.com>
Copyright (c) 1997-8 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Net::LDAP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::LDAP
CPAN shell
perl -MCPAN -e shell install Net::LDAP
For more information on module installation, please visit the detailed CPAN module installation guide.