##
$> = $uid;
$) = $gid;
# Current values are now:
# $> = 99
# $) = "0 1 0"
####
$) = $gid;
$> = $uid;
# Current values are now:
# $> = 99
# $) = "99 2 99"
# Which is the desired outcome
####
($>, $)) = ($uid, $gid;)
# Current values are now:
# $> = 99
# $) = "0 99 2"
# The other groups section has been successfully changed,
# but the actual effective gid has not.