Hello. I'm performing an ldapsearch which returns a lot of results and in order to cope with it I changed my code from a get-all approach to a get-one-by-one one (using a callback). I also have problems with memory because of so many data returned by the search so I'm using the pop_entry() method to consume the entries while they are returned. The problem is that I now get a deep recursion error. Inside the callback I try and modify the entry; there is no error if I do not perform the ldapmodify. I wasn't able to figure out whether my code is wrong or you just cannot do it that way. The code is like:
... $mesg = $ldap->search( base => $base_dn, scope => 'ONE', filter => "username=*", attrs => [EMAIL PROTECTED], callback => \&process_entry ); ... sub process_entry { my $mesg = shift; my $obj = shift; if (!$obj) { print "Search complete\n"; } elsif ($obj->isa('Net::LDAP::Reference')) { ... } else { # don't use $obj, pop_entry it to free memory my $entry = $mesg->pop_entry; unless ($entry) { warn "Cannot pop entry!\n"; return; } ... my $modify = $ldap->modify( ... } } And here are the errors: Deep recursion on subroutine "Net::LDAP::_sendmesg" at /usr/share/perl5/Net/LDAP.pm line 547, <STDIN> line 1. Deep recursion on subroutine "Net::LDAP::sync" at /usr/share/perl5/Net/LDAP.pm line 739, <STDIN> line 1. Deep recursion on subroutine "Net::LDAP::_recvresp" at /usr/share/perl5/Net/LDAP.pm line 695, <STDIN> line 1. Deep recursion on subroutine "Net::LDAP::Search::decode" at /usr/share/perl5/Net/LDAP.pm line 791, <STDIN> line 1. Deep recursion on subroutine "main::process_entry" at /usr/share/perl5/Net/LDAP/Search.pm line 52, <STDIN> line 1. Deep recursion on subroutine "Net::LDAP::Search::decode" at /usr/share/perl5/Net/LDAP.pm line 791, <STDIN> line 1. Deep recursion on subroutine "main::process_entry" at /usr/share/perl5/Net/LDAP/Search.pm line 52, <STDIN> line 1. Deep recursion on subroutine "Net::LDAP::Search::decode" at /usr/share/perl5/Net/LDAP.pm line 791, <STDIN> line 1. Deep recursion on subroutine "main::process_entry" at /usr/share/perl5/Net/LDAP/Search.pm line 52, <STDIN> line 1. Deep recursion on subroutine "Net::LDAP::modify" at ./online_update_dateofbirth.pl line 225, <STDIN> line 1. thank you g.