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

Programming Perl

Programming PerlSearch this book
Previous: 3.2.61 getpwent Chapter 3
Functions
Next: 3.2.63 getpwuid
 

3.2.62 getpwnam

getpwnam 

NAME

This function does the same thing as getpwnam (3): it translates a username to the corresponding passwd file entry. The return value in list context is:

($name,$passwd,$uid,$gid,$quota,$comment,$gcos,$dir,$shell)

If you want to do this repeatedly, consider caching the data in a hash (associative array) using getpwent .

In scalar context, getpwnam returns only the numeric user ID.


Previous: 3.2.61 getpwent Programming Perl Next: 3.2.63 getpwuid
3.2.61 getpwent Book Index 3.2.63 getpwuid