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

Reply via email to