Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: ldap moddn via perl

by kroach (Pilgrim)
on Nov 14, 2017 at 14:36 UTC ( #1203380=note: print w/replies, xml ) Need Help??


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;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1203380]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2020-10-21 13:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (217 votes). Check out past polls.

    Notices?