From: Simon A. <sim...@st...> - 2001-05-31 03:02:14
|
Thanks for the Reply Graham. Callbacks sound like a great idea, but I am not having much luck with them. There isn't much documentation about them. I have tried in on my Solaid box with perl 5.003 and my Debian box with perl 5.6 and get the same result. Source follows: #!/usr/bin/perl use strict; use Net::LDAP; my $authbase = "ou=auth, dc=ihug, dc=co, dc=nz"; my $authpass = "secret"; # Connect and bind to the LDAP Database my $ldap = Net::LDAP->new('delphi.ihug.co.nz') or do { print "Couldn't connect to LDAP database $@\n"; exit 1; }; if (!$ldap->bind("cn=Manager, $authbase", password => $authpass)) { print "Ldap Bind failed!\n"; exit 1; } $ldap->search( base => "$authbase", filter => '(objectclass=ihugAuthAccount)', callback => &check_oracle() ); sub check_oracle { my ($mesg, $entry) = @_; $entry->dump(); } When I run this I get: delphi:~$ ./ldap-test.pl Can't call method "dump" on an undefined value at ./ldap-test.pl line 31. It looks like its calling the right sub, but its not getting passed the varables? Any ideas why? Thanks in Advance - Simon Allard > If this is not possible, try using the callback option. This allows you > to process each entry as it arrives from the server. > > Graham. > > On Tue, May 29, 2001 at 09:41:54AM +0100, Graham Barr wrote: > > ----- Forwarded message from Simon Allard <sim...@st...> ----- > > > > Date: Tue, 29 May 2001 17:51:59 +1200 (NZST) > > To: <gb...@po...> > > From: Simon Allard <sim...@st...> > > Subject: Problem with Net::LDAP > > > > Hey Graham. > > > > I am hopeing you can shed some light on this. I have this problem where > > your module seems to chew up a lot of memory. > > > > I am running openldap 2.0.7 with perl-ldap-0.23. > > > > In openldap I have Aprox 95000 entrys. Each entry looks similar to this: > > > > dn:loginName=dbs, ou=auth, dc=domain, dc=co, dc=nz > > objectclass: AuthAccount > > loginName: dbs > > userPassword: {crypt}sgaCZydxWDFD > > nasAccess: SOMETHING > > smtpAuth: 0 > > overrideProfile: 1 > > multicast: 0 > > > > When I do a basic search eg: > > > > if (!$ldap->bind("cn=Manager, $authbase", password => $authpass, async => 1)) { > > print "Ldap Bind failed!\n"; > > exit 1; > > } > > my $mesg = $ldap->search( > > base => "$authbase", > > filter => '(objectclass=ihugAuthAccount)' > > ); > > > > $ldap->unbind; > > > > This search seems to chew up over 250meg of Ram. It pretty much makes the > > perl module unusable. Do you have any suggestions on how I could get the > > memory usage down to something reasonable? > > > > Also doing the unbind seems to take a very long time :( > > > > Hope you can help. > > Thanks in Advance. > > > > Regards > > Simon Allard > > > > > > > > Simon Allard (Senior Tool Monkey) > > IHUG > > Ph (09) 358-5067 Email: sim...@st... > > > > The real fighting men and women of the 21st century will continue > > to be techo's backed up by the grunts with bad haircuts and rifles. > > > > > > ----- End forwarded message ----- > Simon Allard (Senior Tool Monkey) IHUG Ph (09) 358-5067 Email: sim...@st... The real fighting men and women of the 21st century will continue to be techo's backed up by the grunts with bad haircuts and rifles. |