The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::LDAP::LDIF -- LDIF reading and writing

SYNOPSIS

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();

DESCRIPTION

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.

CONSTRUCTOR

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.

METHODS

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();

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-1999 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.