start page | rating of books | rating of authors | reviews | copyrights

Perl in a Nutshell

Perl in a NutshellSearch this book
Previous: Reference: getpwnam Chapter 5
Function Reference
Next: Reference: getservbyname
 

getpwuid

getpwuid 
uid

Retrieves the passwd file entry with the user ID uid . The return value in list context is:

($name,$passwd,$uid,$gid,$quota,$comment,$gcos,$dir,$shell)
If you want to do this repeatedly, consider slurping the data into a hash using getpwent .

In scalar context, getpwuid returns the username.


Previous: Reference: getpwnam Perl in a Nutshell Next: Reference: getservbyname
Reference: getpwnam Book Index Reference: getservbyname