A suggestion on a possible code optimization:
From what you've described, you have 100,000 entries in LDAP, and 1000 entries in the file. The way your loop works, you're asking LDAP for all of the entries, and then opening the file for _each_entry_ to see if any of the lines in the file match the entry.
At a minimum -- open the file once, and generate a hash using each line in the file as a hash key -- then just test for existance in the hash. (note -- besides the issue with using '=' to compare, as already mentioned, you'll most likely also want to chomp the line to remove line endings)
Even better -- for each one of the lines in the file, extract the sn and givenName, and then do an LDAP search for entries matching those values ... yes, it's 1000 LDAP queries, but they should hopefully be relatively small, and prevent you from needing to process 100,000 records.
In reply to Re: data comparison
by jhourcle
in thread data comparison
by topman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |