in reply to Getting a GID from /etc/group

Yet another way of doing it would be to use User::grent by Tom Christiansen.