From: Graham B. <gb...@po...> - 2003-03-19 13:25:14
|
----- Forwarded message from "Cornily, Jacques" <jac...@ic...> ----- Date: Wed, 19 Mar 2003 13:51:09 +0100 To: "'gb...@po...'" <gb...@po...> From: "Cornily, Jacques" <jac...@ic...> Subject: Callback methode Hi I was wondering if you could help I am currently setting up a callback for a search page result. This works fine. The problem is in the callback functon i want to get access to $self of the calling object Unfortunaly once inside the callback function the context is lost. I have try to pass the context of the calling methode but this works but i am loosing the Net:LDAP seearch context. Hereis the my @searchPageResultArguments = ( 'base' => $self->{"ctxNds"}->{namingContext}, scope => 'subtree', filter => $scenarios{$test_scenario}{filter}, attrs => [ "objectClass" ], sizelimit => $self->{'validDn'}{sizelimit}, control => [ $page ], callback => \&processValidDN($self) , # here i tryied ($self) () ); while(1) { $r=$self->{ "ctxNdsConnectionDescriptor" }->search(@searchPageResultArguments); $r->code and last; $ctrl = $mesg->control( LDAP_CONTROL_PAGED )or last; $cookie = $ctrl->cookie or last; $page->cookie($cookie); print "After a Page :" . $r->error . "\n"; processValidDNs($r); } sub processValidDNs { use Net::LDAP; use Net::LDAP::Entry; use Net::LDAP::Control::Paged; use Net::LDAP::Constant qw( LDAP_CONTROL_PAGED ); use ScMap; my $self = shift; my @keys; if (@_ == 0 ) { @keys = sort keys(%$self); } else { @keys = @_; } my($r) = @keys; print "SELF is " . $self . "\n"; print ":::" . $r->dn; Thanks in advance Jacques ----- End forwarded message ----- |