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.

When Gisle Aas' LWP module package is installed, Net::LDAP::LDIF uses it to also support reading data from the URL types supported by these modules; most prominently http://, https://, and ftp:// resources. This extended feature is dynamically detected at runtime.

FILE may be the name of a file or an already open filehandle. If FILE begins or ends with a | then FILE will be passed directly to open.

MODE can be any of the modes allowed for Perl's open() function, potentially extended by PerlIO layers as described in perlopentut. Alternatively, it can be one of the mode indicators r, r+, w, w+, a, a+ known from C's fopen() function, which get mapped to their Perl counterparts. If MODE is omitted, it defaults to r for reading.

Use REGEX to denote the names of attributes that are to be considered binary when reading.

When this option is given, Net::LDAP converts all values of attributes not matching this REGEX into Perl UTF-8 strings so that the regular Perl operators (pattern matching, ...) can operate as one expects even on strings with international characters.

If this option is not given, attribute values are treated as byte strings.

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.