in reply to Compare usernames

If you think "duplicate" (or "unique"), think about using a hash!

foreach $obj (in $ou){ ... print "$obj->{givenName}\n" ; ... }
In that loop, just create a hash-entry for each user, using $obj->{givenName} as the key...

... unless, however, an entry for that key already exists. In this case you have found a duplicate :-)

HTH, Rata