Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

search entry() index

5 views
Skip to first unread message

Zachary Hanson-Hart

unread,
Jan 7, 2013, 8:51:29 AM1/7/13
to perl...@perl.org
The doc is ambiguous about the argument to the entry( INDEX ) method of a
Net::LDAP::Search object. Is the INDEX 0-based or 1-based?

Below, I'm referring to the CPAN documentation for Net::LDAP::Search 0.14
and Net::LDAP::Entry 0.25.

On the Net::LDAP::Search doc it says that entry( N ) will return the Nth
entry, or undef if N "is greater than the total number of entries". This
implies that it is 1-based.

On the Net::LDAP::Entry doc, the synopsis uses an example with the entry()
method on the search result:

my $max = $mesg->count;
for ( $i = 0 ; $i < $max ; $i++ ) {
my $entry = $mesg->entry ( $i );
}

This is explicitly 0-based.

Can you clarify in the doc (and to the mailing list) which is the correct
interpretation?

Sincerely,
Zachary Hanson-Hart

Peter Marschall

unread,
Jan 19, 2013, 10:23:42 AM1/19/13
to perl...@perl.org
Hi,
A short script gives the answer: it is zero-based.

A fix of the Net::LDAP::Search man page will be in the next release.

Best
Peter
--
Peter Marschall
pe...@adpm.de
0 new messages