Programming Perl

Programming PerlSearch this book
Previous: 3.2.44 getgrentChapter 3
Functions
Next: 3.2.46 getgrnam
 

3.2.45 getgrgid

getgrgid GID

This function does the same thing as getgrgid(3): it looks up a group file entry by group number. The return value in list context is:

($name, $passwd, $gid, $members)

where $members contains a space-separated list of the login names of the members of the group. If you want to do this repeatedly, consider caching the data in a hash (associative array) using getgrent.

In scalar context, getgrgid returns only the group name.


Previous: 3.2.44 getgrentProgramming PerlNext: 3.2.46 getgrnam
3.2.44 getgrentBook Index3.2.46 getgrnam