in reply to Net::LDAP::LDIF->new Chokes on large LDIF because of comments every 5k lines

LDIF.pm Does indeed handle comments (See "sub _read_lines" ~ line 83).

Are you using the latest version of Net::LDIF (0.26) ?

Add some diagnostics to see how far along the LDIF file it is able to read, and at what point if fails.
I suggest printing the first ~250 bytes of Dumper output for each $entry.

                We're living in a golden age. All you need is gold. -- D.W. Robertson.

  • Comment on Re: Net::LDAP::LDIF->new Chokes on large LDIF because of comments every 5k lines

Replies are listed 'Best First'.
Re^2: Net::LDAP::LDIF->new Chokes on large LDIF because of comments every 5k lines
by 3dbc (Monk) on Dec 28, 2017 at 16:34 UTC
    I used some print statements in the loop to find the last dn it processed, then when I immediately looked after it I found the recurring non-complaint ldif comment showing up. So now I process it with perl to remove the comments before reading it into ldif module.

    perl -MNet::LDAP::LDIF -le "print $Net::LDAP::LDIF::VERSION" 0.15
    - 3dbc