in reply to
Re^2: Comparing ldap data using net ldap
in thread Comparing ldap data using net ldap
I haven't tried Net::LDAP::LDIF with several million entries, but I think it can do it. For writing the objects to the LDIF you don't need callbacks from Net::LDAP::LDIF, only the callback from Net::LDAP::Search could be a good idea. If you dump your search result in a sorted way, you can read the objects one-by-one from the LDIF with a code similar to the synopsis from Net::LDAP::LDIF.
perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v184.108.40.206.11.32"