in reply to ldap moddn via perl

I'm not very familiar Net::LDAP and your code is hard to test without a working setup but there are a few suspicious parts in there.

Why do you assign a new $entry variable in the loop over $search->entries? It covers the list iterator making it unusable, so the loop doesn't make much sense.

my $entry = Net::LDAP::Entry->new; # covers $entry from `foreach my +$entry (...`

The moddn() method of Net::LDAP returns a status message, not an LDAP::Search::Entry, that's why you can't use update() on it.

Add the following at the beginning of your script and try to make it work, you may find some errors this way:

use strict; use warnings;