Hi,

comments are an official part of LDIF, but the Perl module doesn't support them 
right now.

RFC 2849 (LDAP Data Interchange Format) says on page 6:

3) Any line that begins with a pound-sign ("#", ASCII 35) is a
comment line, and MUST be ignored when parsing an LDIF file.


Why do I need that? I wrote an LDIF import utility that writes all entries that 
had an error into an LDIF output file for manual (or automatic) review. However it 
would be great to add the LDAP server's error messages as a comment in from of 
every entry.

Code snipplet:
...
            unless ($error) {
                $msg = $ldap->add($e);
                if ($msg->code()) {
                    print "failed to add ", $e->dn(), ': ', $msg->error. "\n";
                    $error = 1;
                }
            }
            if ($error) {
                $ldif_out->write_entry($e);
            }
...

I'm looking for an $ldif_out->write_comment().

Regards,
Ulrich


Reply via email to