From: Allen, R. <ra...@ci...> - 2000-06-27 16:03:52
|
> Neither the Sort or VLV controls have a new method. Instead > they have an init method. One thing you need to do that the docs leave out is use Net::LDAP::Control. All of the controls inherit methods (look at @ISA) from Control.pm (new is one of them). If you don't use or require Net::LDAP::Control, you won't get those methods. The controls (Sort.pm, VLV.pm, etc.) should probably 'use Net::LDAP::Control'. Robbie Allen > When I try to replace new with init, I get this: > "Can't use string ("Net::LDAP::Control::Sort") as a HASH ref > while "strict > refs" in use at > /usr/lib/perl5/site_perl/5.005/Net/LDAP/Control/Sort.pm > line 19." > > I get the same thing if I change init to new in the Sort.pm file. > > I'm using Perl 5.005_03 on Linux with Net::LDAP .19 and > Convert::ASN1 .04. > > And here's the code I'm using to setup the Sort control: > $sort = Net::LDAP::Control::Sort->new( > order => "cn" > ); > > > BTW If you use the VLV control, remember you must also include a sort > control as well. > > Mark > > > On Tue, 27 Jun 2000, Graham Barr wrote: > > > On Mon, Jun 26, 2000 at 08:18:34PM -0700, Allen, Robbie wrote: > > > Do the VLV.pm or Paged.pm modules work under Net::LDAP? > If so, do you > > > have any examples? > > > > Both of these are still under developement, so feel free to > give any feedback. > > > > Paged should work something like > > > > $paged = Net::LDAP::Control::Paged->new( size => 10 ); > > > > $mesg = $ldap->search( control => [ $paged ], .... ); > > > > $ctrl = $mesg->control( LDAP_CONTROL_PAGED ); > > > > $paged->cookie($ctrl->cookie) if $ctrl; > > > > $mesg = $ldap->search( control => [ $paged ], .... ); > > > > VLV takes these arguments > > > > $vlv = Net::LDAP::Control::VLV->new( > > before => $beforeCount, > > after => $afterCount, > > assert => $assertValue, > > offset => $offset, > > content => $contentCount, > > context => $contextID, # just noticed a bug that this > is missing from new() > > ); > > > > If assert is present offset and content are not used. There > are methods > > by the same names for setting the values. > > > > In the response you will get a LDAP_CONTROL_VLVRESPONSE > which will have > > methods target, result, content and context > > > > Graham. > > > > > > > > > > > |