The * in (.*) is "greedy", meaning the Perl regular expression engine will try to match as much as possible in each string after it finds the substring 'cn='. To make it "non-greedy", put a question mark after the quantifier: s/^cn=(.*?),/$1/
Note that the '.*$' characters ending your pattern are completely superfluous and will not affect the match or substitution in any way.
Another way to achieve the same results is to match all non-comma characters up to the first comma: s/^cn=([^,]*),/$1/
Also note that since $_ inside the map block is an alias to the array members, you are modifying the array members in place, and you do not need to assign the result to the original array. Since using map in void context can be confusing, many Perl programmers would write it this way:
s/^cn=([^,]*),/$1/ for @memberof;
Since I wouldn't normally want to modify the original array, I might do it this way, taking advantage of the fact that the match operator (m//) in list context returns a list of the captured matches, so no substitution is required:
my @newmemberof = map { m/^cn=([^,]*),/g } @memberof;