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

Graham Barr <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.ldap
Message-ID <[email protected]>
$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. 
>
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.