Doesn't that return the size of this particular page, rather than the server
estimate of the total number?  I could be wrong...

Regards,

Edward.

-----Original Message-----
From: Chris Ridd [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 26, 2003 5:42 PM
To: Perl-LDAP Mailing List
Cc: Edward Hibbert
Subject: Re: [Fwd: Query]


On 26/6/03 5:24 pm, Graham Barr <[EMAIL PROTECTED]> wrote:

> -----Forwarded Message-----
> From: Edward Hibbert <[EMAIL PROTECTED]>
> To: '[EMAIL PROTECTED]' <[EMAIL PROTECTED]>
> Subject: Query
> Date: 26 Jun 2003 17:10:13 +0100
> 
> Hi,
> 
> I'm using your perl LDAP paged results module.  I'm not sure how to
extract
> the estimate of the total size of the results which the LDAP server sends
> back with the first page.  This might just be because you need to use a
perl
> trick I'm not familiar with - but can you give me any pointers?

The paged control response object has a 'size' method which should return
the value, so (following the example in the Net::LDAP::Control::Paged
perldoc):

While (1) {
  my $mesg = $ldap->search(@args);
  $mesg->code and last;
  my $resp = $mesg->control( LDAP_CONTROL_PAGED ) or last;
  my $size = $res->size;
  ...
}

This may need documenting (in the doc mentioned above), especially if it
works.

Cheers,

Chris

Reply via email to