in reply to Net::LDAP doesn't return until end of loop
The docs say that the second object passed to the callback for a search will be an entry found:
If the request is a search then multiple packets can be received from the server. Each entry is received as a separate packet. For each of these the subroutine will be called with a Net::LDAP::Entry object as the second argument.
So I think the callback should look like this:
sub callback { my ($searchobj, $entry) = @_; # note: no 'shift' if ($entry) { print $entry->dn, "\n"; print $entry->get_value('plan'); print $entry->get_value('ipaddress'); print $entry->get_value('username'); } else { warn "No entry passed in for callback...\n"; } }
This will at least let you know that your callback is being called the appropriate number of times.
Chris
M-x auto-bs-mode
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Net::LDAP doesn't return until end of loop
by ypcat (Beadle) on Jun 30, 2003 at 22:01 UTC | |
by lachoy (Parson) on Jul 01, 2003 at 01:48 UTC | |
by ypcat (Beadle) on Jul 01, 2003 at 05:07 UTC | |
by lachoy (Parson) on Jul 01, 2003 at 12:21 UTC | |
by ypcat (Beadle) on Sep 17, 2003 at 06:26 UTC |
In Section
Seekers of Perl Wisdom