adamsj has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to move from an LDAP server which allowed huge queries to an AD server that limits me to a thousand records, and Net::LDAP::Control::Paged looks like the tool I need. But I can't for the life of me understand what the callback function is supposed to be.

They laughed at Joan of Arc, but she went right ahead and built it. --Gracie Allen
  • Comment on What do I use for the callback function in Net::LDAP::Control::Paged?

Replies are listed 'Best First'.
Re: What do I use for the callback function in Net::LDAP::Control::Paged?
by marto (Cardinal) on Oct 08, 2025 at 07:27 UTC

    You've not said what you want to do with each of the results you're paging through. For example to print the DN for each result:

    sub process_entry { my ($message, $entry) = @_; return unless $entry; say $entry->dn; $message->pop_entry; }

    See Using the callback subroutine approach from Net::LDAP::FAQ.

      Thanks so much! Now I understand--and thanks also for the link to the FAQ.

      They laughed at Joan of Arc, but she went right ahead and built it. --Gracie Allen