Home
Search Perl pages
Subjects
By activity
Professions, Sciences, Humanities, Business, ...
User Interface
Text-based, GUI, Audio, Video, Keyboards, Mouse, Images,...
Text Strings
Conversions, tests, processing, manipulation,...
Math
Integer, Floating point, Matrix, Statistics, Boolean, ...
Processing
Algorithms, Memory, Process control, Debugging, ...
Stored Data
Data storage, Integrity, Encryption, Compression, ...
Communications
Networks, protocols, Interprocess, Remote, Client Server, ...
Hard World Timing, Calendar and Clock, Audio, Video, Printer, Controls...
File System
Management, Filtering, File & Directory access, Viewers, ...
|
|
|
getpwnam NAME
getgrnam NAME
gethostbyname NAME
getnetbyname NAME
getprotobyname NAME
getpwuid UID
getgrgid GID
getservbyname NAME,PROTO
gethostbyaddr ADDR,ADDRTYPE
getnetbyaddr ADDR,ADDRTYPE
getprotobynumber NUMBER
getservbyport PORT,PROTO
getpwent
getgrent
gethostent
getnetent
getprotoent
getservent
setpwent
setgrent
sethostent STAYOPEN
setnetent STAYOPEN
setprotoent STAYOPEN
setservent STAYOPEN
endpwent
endgrent
endhostent
endnetent
endprotoent
endservent
These routines perform the same functions as their counterparts in the
system library. Within a list context, the return values from the various
get routines are as follows:
($name,$passwd,$uid,$gid,
$quota,$comment,$gcos,$dir,$shell) = getpw*
($name,$passwd,$gid,$members) = getgr*
($name,$aliases,$addrtype,$length,@addrs) = gethost*
($name,$aliases,$addrtype,$net) = getnet*
($name,$aliases,$proto) = getproto*
($name,$aliases,$port,$proto) = getserv*
(If the entry doesn't exist you get a null list.)
Within a scalar context, you get the name, unless the function was a lookup
by name, in which case you get the other thing, whatever it is. (If the
entry doesn't exist you get the undefined value.) For example:
$uid = getpwnam
$name = getpwuid
$name = getpwent
$gid = getgrnam
$name = getgrgid
$name = getgrent
etc.
The $members value returned by getgr*() is a space separated list of the login names of the members of the group.
For the gethost*() functions, if the h_errno variable is supported in
C, it will be returned to you via $? if the function call fails. The @addrs value returned by a
successful call is a list of the raw addresses returned by the
corresponding system library call. In the Internet domain, each address is
four bytes long and you can unpack it by saying something like:
($a,$b,$c,$d) = unpack('C4',$addr[0]);
Source: Perl builtin functions Perl builtin functions Perl builtin functions Perl builtin functions Perl builtin functions Perl builtin functions Perl builtin functions Perl builtin functions Perl builtin functions Perl builtin functions Perl builtin functions Perl builtin functions Perl builtin functions Perl builtin functions Perl builtin functions Perl builtin functions Perl builtin functions Perl builtin functions Perl builtin functions Perl builtin functions Perl builtin functions Perl builtin functions Perl builtin functions Perl builtin functions Perl builtin functions Perl builtin functions Perl builtin functions Perl builtin functions Perl builtin functions Perl builtin functions Copyright: Larry Wall, et al. |
Next: getsockname SOCKET Next: endservent Next: endprotoent Next: endnetent Next: endhostent Next: endgrent Next: endpwent Next: setservent STAYOPEN Next: setprotoent STAYOPEN Next: setnetent STAYOPEN Next: sethostent STAYOPEN Next: setgrent Next: setpwent Next: getservent Next: getprotoent Next: getnetent Next: gethostent Next: getgrent Next: getpwent Next: getservbyport PORT,PROTO Next: getprotobynumber NUMBER Next: getnetbyaddr ADDR,ADDRTYPE Next: gethostbyaddr ADDR,ADDRTYPE Next: getservbyname NAME,PROTO Next: getgrgid GID Next: getpwuid UID Next: getprotobyname NAME Next: getnetbyname NAME Next: gethostbyname NAME Next: getgrnam NAME
Previous: endprotoent Previous: endnetent Previous: endhostent Previous: endgrent Previous: endpwent Previous: setservent STAYOPEN Previous: setprotoent STAYOPEN Previous: setnetent STAYOPEN Previous: sethostent STAYOPEN Previous: setgrent Previous: setpwent Previous: getservent Previous: getprotoent Previous: getnetent Previous: gethostent Previous: getgrent Previous: getpwent Previous: getservbyport PORT,PROTO Previous: getprotobynumber NUMBER Previous: getnetbyaddr ADDR,ADDRTYPE Previous: gethostbyaddr ADDR,ADDRTYPE Previous: getservbyname NAME,PROTO Previous: getgrgid GID Previous: getpwuid UID Previous: getprotobyname NAME Previous: getnetbyname NAME Previous: gethostbyname NAME Previous: getgrnam NAME Previous: getpwnam NAME Previous: getpriority WHICH,WHO
(Corrections, notes, and links courtesy of RocketAware.com)
Up to: Host, service name, and address operations Up to: Host, service name, and address operations Up to: Host, service name, and address operations Up to: Host, service name, and address operations Up to: Process Limits: Identity Up to: Process Limits: Identity Up to: Host, service name, and address operations Up to: Host, service name, and address operations Up to: Host, service name, and address operations Up to: Host, service name, and address operations Up to: Process Limits: Identity Up to: Process Limits: Identity Up to: Host, service name, and address operations Up to: Host, service name, and address operations Up to: Host, service name, and address operations Up to: Host, service name, and address operations Up to: Process Limits: Identity Up to: Process Limits: Identity Up to: Host, service name, and address operations Up to: Host, service name, and address operations Up to: Host, service name, and address operations Up to: Host, service name, and address operations Up to: Host, service name, and address operations Up to: Process Limits: Identity Up to: Process Limits: Identity Up to: Host, service name, and address operations Up to: Host, service name, and address operations Up to: Host, service name, and address operations Up to: Process Limits: Identity Up to: Process Limits: Identity
Rapid-Links:
Search | About | Comments | Submit Path: RocketAware > Perl >
perlfunc/getpwnam.htm
RocketAware.com is a service of Mib Software Copyright 2000, Forrest J. Cavalier III. All Rights Reserved. We welcome submissions and comments
|