in reply to Re: Re: Net::LDAP doesn't return until end of loop
in thread Net::LDAP doesn't return until end of loop
Two things: First, you probably want to pass \@attrs or [ @attrs ] instead of what you've got. You might also need to set scope => 'sub' in the search attributes.
Second, I'd try a different strategy, using this idiom to run through the results of a search:
my $ldap_msg = $ldap->search( ... ); if ( my $code = $ldap_msg->code ) { die "Error running search: ", Net::LDAP::Util::ldap_error_text( $code ); } while ( my $entry = $ldap_msg->shift_entry ) { # use $entry }
It's been a while since I used LDAP and I just cribbed this from SPOPS::LDAP, which I wrote when I was using LDAP :-)
Chris
M-x auto-bs-mode
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Different Strategy (Was: Net::LDAP doesn't return until end of loop)
by ypcat (Beadle) on Jul 01, 2003 at 05:07 UTC | |
by lachoy (Parson) on Jul 01, 2003 at 12:21 UTC | |
Re: Different Strategy (Was: Net::LDAP doesn't return until end of loop)
by ypcat (Beadle) on Sep 17, 2003 at 06:26 UTC |
In Section
Seekers of Perl Wisdom