Getting members from groups in code

My end goal is a table/chart laid out like this:

Tech name || # Tickets created today || # Tickets owned total

The users (“techs”) that I want this chart created for are in certain
groups I have made. Let’s say they are separated in to groups AAA, BBB
and CCC with some users being members of more than one (or all) of
these groups.

How, abstractly or in perl, would I go about getting “all the distinct
users in groups AAA, BBB and CCC”?

Thanks for any help.

Trask Rogers
Technical Support Engineer
Lyris Technologies, Inc.