From: <CZa...@wi...> - 2002-04-11 21:15:09
|
I am try to detect any duplicate entries in my LDAP Service directory and print to STDOUT or, to a file. But, I first wanted to see if it would pass back all duplicates. Jim Harle <harle@usna.ed To: CZa...@wi... u> cc: per...@li... Subject: Re: Checking for duplicate entries 04/11/2002 05:03 PM Please be more precise about what you are trying to do. The code you included works fine if I use $var1 = 'John'; $var2 = 'Smith'; on my server, I get the 2 entries just fine. I would change unless $seen{$entry} to unless $seen{$entry->dn} but I don't think that will do anything in this case. Are you trying to find all sn/givenname combinationss where more than one match? --Jim On Thu, 11 Apr 2002 CZa...@wi... wrote: > Hello, can anyone help on this. I am trying to display duplicate enties > that are in > the ldap service. > > %seen = (); > $mesg = $ldap->search( > base => "o=base", > scope => "subtree", > filter => "(&(givenname=$var1) (sn =$var2))" > ); > > foreach $entry ($mesg->entries) { > printf "%s \n", $entry->dn unless $seen{$entry}++ > } > > |