Re: NET::LDAP Search Works, pop_entry problematic #2

[email protected]
Newsgroups gmane.comp.lang.perl.modules.ldap
Message-ID <426472122.1295266.1281560044464.JavaMail.root@sz0046a.emeryville.ca.mail.comcast.net>

Hello Graham, 



Can you expand your helpful suggestions a bit. I've tried these without success. How can the code below be modified to make $entry->dn work? Thanks very much. 








$ldap->search(...) will return a Net::LDAP::Search object, not a DN as you seem to be expecting.
You can tell this from the way in which perl string-ifies the object to "Net::LDAP::Search=HASH(0x1844ba4)"

$entry = $dn->pop_entry; will given you the first entry in the result set as a Net::LDAP::Entry obejct,
or undef of there were no objects found.

$entry->dn would then give you the DN of that entry.

Hope this helps.

Graham.

On Jul 1, 2010, at 3:17 PM, [email protected] wrote:

> 
> 
> Making these changes: 
> 
> my $true = 1; 
> while ($true) { 
> print OUT "$dn", "\n"; 
> #        $entry = $dn->pop_entry; 
> #        print $result->write_entry($entry); 
>         #next unless $dn; 
>         print OUT "changetype: modify", "\n"; 
>         print OUT "replace: manager", "\n"; 
> } 
> 
> 
> 
> Causes this output...so is there is another method to decode the HASH? 
> 
> 
> 
> Net::LDAP::Search=HASH(0x1844ba4) 
> changetype: modify 
> replace: manager 
> Net::LDAP::Search=HASH(0x1844ba4) 
> changetype: modify 
> replace: manager 
> Net::LDAP::Search=HASH(0x1844ba4) 
> changetype: modify 
> replace: manager 
> 
> 
> 
> 
> 
> Thank you very much for your time and advise. 
> Thread Previous 

    • NET::LDAP Search Works, pop_entry problematic #2 by rfransix 
        • Re: NET::LDAP Search Works, pop_entry problematic #2 by Graham Barr
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.