use POSIX qw(getgroups); # get list of the current groups for this process my @gidlist=getgroups(); # you'd have to translate numeric gid's to # the names here