User::pwent

use User::pwent;            # Standard überschreibt nur eingebaute Funktionen.
$pw = getpwnamC'daemon")  or die "Kein Benutzer daemon";
if ($pw->uid == 1 && $pw->dir =~ m#^/(bin|tmp)?$# ) {
     print "gid 1 auf root-Verzeichnis";
}

$pw = getpw($whoever);      # Akzeptiert String und Zahl.
$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); # Setzt globale Variablen im aktuellen Paket. getpwnam("daemon") or die "Kein Benutzer daemon"; if ($pw_uid == 1 && $pw_dir =~ m#^/(bin|tmp)?$# ) { print "gid 1 auf root-Verzeichnis"; } use User::pwent qw/pw_has/; if (pw_has(qw[gecos expire quota])) { .... } if (pw_has("name uid gid passwd")) ...

Get Programmieren mit Perl now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.