Perl Cd Bookshelf [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Perl Cd Bookshelf [Electronic resources] - نسخه متنی

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید



8.230. User::pwent


Overrides core
getpwent, getpwuid, and
getpwnam functions with versions that return
User::pwent objects. The object returned has methods with the same
names as the structure fields they return. That is, to return the
field name, use the name
method:

use User::pwent;
$pw = getpwnam('daemon') or die "No daemon user";
if ( $pw->uid == 1 && $pw->dir =~ m#^/(bin|tmp)?$# ) {
print "gid 1 on root dir";
}

The field names (and therefore the method names) are the same as the
names of the fields in the passwd structure from
the C file pwd.h: name,
passwd, uid,
gid, quota,
comment, gecos,
dir, and shell. You can
access the fields with the methods or by importing the fields into
your namespace with the :FIELDS import tag and prepending
pw_ to the method name (for example,
pw_name). Exports four functions.

getpw


$pw->getpw(arg)

Frontend that forwards a numeric arg to
getpwuid and other args
to getpwnam.

getpwent


$pw->getpwent( )

Successive calls to getpwent return objects
representing successive entries from the password table.

getpwnam


$pw->getpwnam(name)

Accesses the password table by user's
name.

getpwuid


$pw->getpwuid(uid)

Accesses the password table by user's ID number,
uid.



8.229. User::grent8.231. utf8




Copyright © 2002 O'Reilly & Associates. All rights reserved.

/ 875