noname has asked for the wisdom of the Perl Monks concerning the following question:

I use Net::Ldap::Entry for generating ldif's which I later feed to the ldap server with ldapadd ( well not the most elegant solution, but I like to check the ldif before executing it on the server)

So for example the code like that works just fine:
sub mkgrp{ my $ldapgrp = Net::LDAP::Entry->new; my $group_dn = 'cn='.$group.',ou=group,'.$topdn; my $description = $descr || $group; $ldapgrp->dn($group_dn); $ldapgrp->add( objectClass => [ qw(sambaGroupMapping posixGroup )], displayName => $group, sambaGroupType => '2', sambaSID => 'S--blablabla-'.${groupSID}, description => $description, gidNumber => $gid, cn => $group, memberUID => [ @memberUID ], ); return $ldapgrp; } my $ldif = Net::LDAP::LDIF->new( "$ldifpath", "w+", onerror => 'warn' + ); $ldifpath = "/tmp/${group}.ldif"; $ldif->write_entry($ldapgrp);

What I can not achieve with this module is to create an ldif with multiple changes to the same DN

For example I see no way to generate such ldif:

print $fh <<"END"; dn: $dn changetype: modify add: mail mail: $maillist - add: mailAlternateAddress mailAlternateAddress: - add: mailMessageStore mailMessageStore: - replace: objectClass objectClass: posixGroup objectClass: qmailGroup objectClass: sambaGroupMapping END
Is there a way to do that with Net::LDAP::Entry or any other module or shell I just give up?