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 |
|---|---|
| List of aliases |
| Name of service |
| Port |
| 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
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access