ActiveState!

ActivePerl Documentation
Table of Contents

(Usage Statistics)
(about this ver)


* Getting Started
    * Welcome To ActivePerl
    * Release Notes
    * Readme
    * ActivePerl Change Log
* Install Notes
    * Linux
    * Solaris
    * Windows
* ActivePerl Components
    * Overview
    * PPM
    * Windows Specifics
       * OLE Browser
       * PerlScript
       * Perl for ISAPI
       * PerlEZ
* ActivePerl FAQ
    * Introduction
    * Availability & Install
    * Using PPM
    * Docs & Support
    * Windows Specifics
       * Perl for ISAPI
       * Windows 9X/NT/2000
       * Quirks
       * Web Server Config
       * Web programming
       * Programming
       * Modules & Samples
       * Embedding & Extending
       * Using OLE with Perl
* Windows Scripting
    * Active Server Pages
    * Windows Script Host
    * Windows Script Components

Core Perl Documentation


* perl
* perlfaq
* perltoc
* perlbook

* perlsyn
* perldata
* perlop
* perlreftut
* perldsc
* perllol

* perllexwarn
* perldebug

* perlrun
* perlfunc
* perlopentut
* perlvar
* perlsub
* perlmod
* perlpod

* perlstyle
* perlmodlib
* perlmodinstall
* perltrap
* perlport
* perlsec

* perlref
* perlre
* perlform
* perllocale
* perlunicode

* perlboot
* perltoot
* perltootc
* perlobj
* perlbot
* perltie

* perlipc
* perlnumber
* perlfork
* perlthrtut

* perldiag
* perlfaq1
* perlfaq2
* perlfaq3
* perlfaq4
* perlfaq5
* perlfaq6
* perlfaq7
* perlfaq8
* perlfaq9

* perlcompile

* perlembed
* perlxstut
* perlxs
* perlguts
* perlcall
* perlfilter
* perldbmfilter
* perlapi
* perlintern
* perlapio
* perltodo
* perlhack

* perlhist
* perldelta
* perl5005delta
* perl5004delta

* perlamiga
* perlcygwin
* perldos
* perlhpux
* perlmachten
* perlos2
* perlos390
* perlvms
* perlwin32

Pragmas


* attributes
* attrs
* autouse
* base
* blib
* bytes
* charnames
* constant
* diagnostics
* fields
* filetest
* integer
* less
* lib
* locale
* lwpcook
* open
* ops
* overload
* perllocal
* re
* sigtrap
* strict
* subs
* utf8
* vars
* warnings

Libraries


* ActivePerl
    * DocTools
        * TOC
            * RDF
* AnyDBM_File
* Archive
    * Tar
* AutoLoader
* AutoSplit
* B
    * Asmdata
    * Assembler
    * Bblock
    * Bytecode
    * C
    * CC
    * Debug
    * Deparse
    * Disassembler
    * Lint
    * Showlex
    * Stackobj
    * Terse
    * Xref
* Benchmark
* Bundle
    * LWP
* ByteLoader
* Carp
    * Heavy
* CGI
    * Apache
    * Carp
    * Cookie
    * Fast
    * Pretty
    * Push
    * Switch
* Class
    * Struct
* Compress
    * Zlib
* Config
* CPAN
    * FirstTime
    * Nox
* Cwd
* Data
    * Dumper
* DB
* Devel
    * DProf
    * Peek
    * SelfStubber
* Digest
    * HMAC
    * HMAC_MD5
    * HMAC_SHA1
    * MD2
    * MD5
    * SHA1
* DirHandle
* Dumpvalue
* DynaLoader
* English
* Env
* Errno
* Exporter
    * Heavy
* ExtUtils
    * Command
    * Embed
    * Install
    * Installed
    * Liblist
    * MakeMaker
    * Manifest
    * Miniperl
    * Mkbootstrap
    * Mksymlists
    * MM_Cygwin
    * MM_OS2
    * MM_Unix
    * MM_VMS
    * MM_Win32
    * Packlist
    * testlib
* Fatal
* Fcntl
* File
    * Basename
    * CheckTree
    * Compare
    * Copy
    * CounterFile
    * DosGlob
    * Find
    * Glob
    * Listing
    * Path
    * Spec
        * Functions
        * Mac
        * OS2
        * Unix
        * VMS
        * Win32
    * stat
* FileCache
* FileHandle
* FindBin
* Font
    * AFM
* Getopt
    * Long
    * Std
* HTML
    * AsSubs
    * Element
    * Entities
    * Filter
    * Form
    * FormatPS
    * Formatter
    * FormatText
    * HeadParser
    * LinkExtor
    * Parse
    * Parser
    * TokeParser
    * TreeBuilder
* HTTP
    * Cookies
    * Daemon
    * Date
    * Headers
        * Util
    * Message
    * Negotiate
    * Request
        * Common
    * Response
    * Status
* I18N
    * Collate
* IO
    * Dir
    * File
    * Handle
    * Pipe
    * Poll
    * Seekable
    * Select
    * Socket
        * INET
        * UNIX
* IPC
    * Msg
    * Open2
    * Open3
    * Semaphore
    * SysV
* LWP
    * Debug
    * MediaTypes
    * MemberMixin
    * Protocol
    * RobotUA
    * Simple
    * UserAgent
* Math
    * BigFloat
    * BigInt
    * Complex
    * Trig
* MD5
* MIME
    * Base64
    * QuotedPrint
* NDBM_File
* Net
    * Cmd
    * Config
    * Domain
    * DummyInetd
    * FTP
    * hostent
    * libnetFAQ
    * netent
    * Netrc
    * NNTP
    * PH
    * Ping
    * POP3
    * protoent
    * servent
    * SMTP
    * SNPP
    * Time
* O
* ODBM_File
* Opcode
* Pod
    * Checker
    * Find
    * Html
    * InputObjects
    * Man
    * Parser
    * ParseUtils
    * Plainer
    * Select
    * Text
        * Color
        * Termcap
    * Usage
* POSIX
* PPM
    * SOAPClient
    * SOAPServer
* Safe
* SDBM_File
* Search
    * Dict
* SelectSaver
* SelfLoader
* SHA
* Shell
* SOAP
    * Defs
    * Envelope
    * EnvelopeMaker
    * GenericHashSerializer
    * GenericInputStream
    * GenericScalarSerializer
    * Lite
    * OutputStream
    * Packager
    * Parser
    * Transport
        * HTTP
            * Apache
            * CGI
            * Client
            * Server
        * LOCAL
        * MAILTO
        * POP3
        * TCP
    * TypeMapper
* Socket
* Symbol
* Sys
    * Hostname
    * Syslog
* Term
    * ANSIColor
    * Cap
    * Complete
    * ReadLine
* Test
    * Harness
* Text
    * Abbrev
    * ParseWords
    * Soundex
    * Tabs
    * Wrap
* Thread
    * Queue
    * Semaphore
    * Signal
    * Specific
* Tie
    * Array
    * Handle
    * Hash
    * RefHash
    * Scalar
    * SubstrHash
* Time
    * gmtime
    * Local
    * localtime
    * tm
* UDDI
    * Lite
* UNIVERSAL
* URI
    * data
    * Escape
    * file
    * Heuristic
    * ldap
    * URL
    * WithBase
* User
    * grent
    * pwent
* Win32
    * AuthenticateUser
    * ChangeNotify
    * Clipboard
    * Console
    * Event
    * EventLog
    * File
    * FileSecurity
    * Internet
    * IPC
    * Mutex
    * NetAdmin
    * NetResource
    * ODBC
    * OLE
        * Const
        * Enum
        * NEWS
        * NLS
        * TPJ
        * Variant
    * PerfLib
    * Pipe
    * Process
    * Registry
    * Semaphore
    * Service
    * Sound
    * TieRegistry
* Win32API
    * File
    * Net
    * Registry
* WWW
    * RobotRules
        * AnyDBM_File
* XML
    * Element
    * Parser
        * Expat
    * PPD
    * PPMConfig
    * ValidatingElement
* XSLoader

 Net::LDAP::Entry -- An LDAP entry object


NAME

Net::LDAP::Entry -- An LDAP entry object


SUPPORTED PLATFORMS

  • Linux
  • Solaris
  • Windows
This module is not included with the standard ActivePerl distribution. It is available as a separate download using PPM.

SYNOPSIS

  use Net::LDAP;
  $ldap = Net::LDAP->new($host);
  $mesg = $ldap->search(@search_args);
  my $max = $mesg->count;
  for($i = 0 ; $i < $max ; $i++) {
    my $entry = $mesg->entry($i);
    foreach my $attr ($entry->attributes) {
      print join("\n ",$attr, $entry->get($attr)),"\n";
    }
  }
  # or
  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)]
  );

  $entry->update( $ldap ); # update directory server


DESCRIPTION

The Net::LDAP::Entry object represents a single entry in the directory. It is a container for attribute-value pairs.

A Net::LDAP::Entry object can be used in two situations. The first and probably most common use is in the result of a search to the directory server.

The other is where a new object is created locally and then a single command is sent to the directory server to add, modify or replace an entry. Entries for this purpose can also be created by reading an LDIF file with the the Net::LDAP::LDIF manpage module.


CONSTRUCTOR


METHODS

add ( ATTR => VALUE [, ATTR2 => VALUE2 ... ] )
Add one or more new attributes to the entry. Each value must be a scalar variable or a reference to an array. The values given will be added to the values which already exist for the given attributes.
  $entry->add( 'sn' => 'Barr');
  $entry->add( 'street' => [ '1 some road','nowhere']);

NOTE: these changes are local to the client and will not appear on the directory server until the update method is called.

replace ( ATTR => VALUE [, ATTR2 => VALUE2 ... ] )
Similar to add, except that the values given will replace any values that already exist for the given attributes.

NOTE: these changes are local to the client and will not appear on the directory server until the update method is called.

delete ( [ ATTR [, ATTR2 ... ]] )
Delete the given attributes from the entry. If no attributes are passed then the next call to update will cause the entry to be deleted from the server.

NOTE: these changes are local to the client and will not appear on the directory server until the update method is called.

dn ( [ DN ] )
Set or get the DN for the entry. With no arguments dn will return the current DN. If an argument is given then it will change the DN for the entry and return the previous value.

NOTE: these changes are local to the client and will not appear on the directory server until the update method is called.

update ( [ CLIENT ] )
Update the directory server with any changes that have been made locally. This means any calls that have been made to add, replace or delete since the last call to changetype or update was made.

CLIENT should be a Net::LDAP object where the update should be sent to.

CLIENT is only optional is the Net::LDAP::Entry object was created by a search on a directory server. In which case, if omitted, the update will be sent back to the same server.

The result will be an object of type Net::LDAP::Message as returned by the add, modify or delete method called on CLIENT.

attributes
Return a list of attributes that this entry has.

get ( ATTR )
Get the values for the attribute ATTR. The result will be a reference to an array, if that attribute exists. If the attribute does not exist the undef will be returned.

changetype ( [ TYPE ] )
If called without arguments it returns the type of operation that would be performed when the update method is called. If called with an argument it will set the changetype to TYPE.

Possible values for TYPE are

add
The update method will call the add method on the client object, which will result in the entry being added to the directory server.

delete
The update method will call the delete method on the client object, which will result in the entry being removed from the directory server.

modify
The update method will call the modify method on the client object, which will result in any changes that have been made locally being made to the entry on the directory server.


SEE ALSO

the Net::LDAP manpage, the Net::LDAP::LDIF manpage


AUTHOR

Graham Barr <gbarr@pobox.com>.

Please report any bugs, or post any suggestions, to the perl-ldap mailing list <perl-ldap@mail.med.cornell.edu>.


COPYRIGHT

Copyright (c) 1997-2000 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.

 Net::LDAP::Entry -- An LDAP entry object