February 2012
Intermediate to advanced
1184 pages
37h 17m
English
getpwuid UIDThis function translates a numeric user ID to the corresponding /etc/passwd file entry. The return value in list context is:
# 0 1 2 3 4 5 6 7 8 ($name,$passwd,$uid,$gid,$quota,$comment,$gcos,$dir,$shell) = getpwuid(2);
For repeated lookups, consider caching the data in a hash using
getpwent.
In scalar context, getpwuid
returns the username. The User::pwent module supports a by-name interface to this function. See
getpwnam(3) and
passwd(5).
Read now
Unlock full access