Perl Cd Bookshelf [Electronic resources]

نسخه متنی -صفحه : 875/ 210
نمايش فراداده

8.162. Net::servent

Returns information for an Internet service. Overrides the core getservent, getservbyname, and getservbyport functions, replacing them with versions that return Net::servent objects. The functions take a default second argument of tcp. The objects have methods that return the fields of the same name from the servent structure in netdb.h:

Field

Description

aliases

List of aliases

name

Name of service

port

Port

proto

Protocol to use

You can access the structure fields with the methods or by importing the fields into your namespace with the :FIELDS import tag and accessing them by prepending s_ to the field name:

$serv_obj->name( ) $s_name

getserv

getserv(service)

Frontend for getservbyport and getservbyname. If service is numeric, calls getservbyport; otherwise, calls getservbyname.

getservbyname

getservbyname(name)

Returns information for the Internet service with protocol name name.

getservbyport

getservbyport(port)

Returns information for the Internet service with port number port.

getservent

getservent

Returns entries from the database of Internet services.


8.161. Net::protoent8.163. Net::SMTP


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