User-Pwent

User::pwent(3p) Perl Programmers Reference Guide User::pwent(3p)

User-Pwent

User::pwent(3p) Perl Programmers Reference Guide User::pwent(3p) # User::pwent(3p) Perl Programmers Reference Guide User::pwent(3p) NNAAMMEE # User::pwent - by-name interface to Perl's built-in getpw*() functions SSYYNNOOPPSSIISS # use User::pwent; $pw = getpwnam('daemon') || die "No daemon user"; if ( $pw->uid == 1 && $pw->dir =~ m#^/(bin|tmp)?\z#s ) { print "gid 1 on root dir"; } $real_shell = $pw->shell || '/bin/sh'; for (($fullname, $office, $workphone, $homephone) = split /\s*,\s*/, $pw->gecos) { s/&/ucfirst(lc($pw->name))/ge; } use User::pwent qw(:FIELDS); getpwnam('daemon') || die "No daemon user"; if ( $pw_uid == 1 && $pw_dir =~ m#^/(bin|tmp)? ...