$mesg = $ldap->search(base => "o=UMMC", filter => $filter, attrs => ["dn"]); ... $entry = $mesg->shift_entry; $mesg = $ldap->bind($entry->dn, password => "$passWord"); ... #The following is meant to convert the group name passed #in to cn form, because only "group01" would be passed $groupCmp = $entry->dn; $groupCmp =~ s/(cn=)(.*?)(,.*)/$1$group$3/; $mesg = $ldap->compare($entry->dn, attr => "groupMembership",value => "$groupCmp");