|
Net::LDAP::LDIF -- LDIF reading and writing
|
Net::LDAP::LDIF -- LDIF reading and writing
This module is not included with the standard ActivePerl distribution. It is available as a separate download using PPM.
use Net::LDAP::LDIF;
$ldif = Net::LDAP::LDIF->new( ``file.ldif'', ``r'' );
while( $entry = $ldif->read() ) {
# Do things with $entry
}
$ldif->done();
$ldif = Net::LDAP::LDIF->new( $fh, ``r'' );
@entries = $ldif->read();
Net::LDAP::LDIF provides a means to convert between Net::LDAP::Entry objects
and LDAP entries represented in LDIF format files. Reading and writing are
supported and may manipulate single entries or lists of entries.
As when reading an entire file into memory with perl normally, take into
account the possibility of memory use when loading an LDIF file in one go.
- new ( [ FILE [, MODE]] )
-
FILE may be the name of a file or an already open filehandle. If a filename
is passed in then it will be opened with the mode specified.
MODE defaults to ``r'' for read. You may specify ``w'' to for write+truncate or
``a'' for write+append.
- read
-
In a similar fashion to the perl <$fh> operator, read will read one entry or
the entire file depending on whether it is called in a scalar or array context.
- read_cmd
-
- write ( ENTRIES )
-
- write_cmd ( ENTRIES )
-
- done
-
This method signals that the LDIF object is no longer needed. If a file was
opened automatically when the object was created it will be closed. This
method is called automatically via DESTROY when the object goes out of scope.
$ldif->done();
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 (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::LDIF -- LDIF reading and writing
|
|