Net::hostent
Overrides the core gethostbyname and gethostbyaddr functions with object-oriented
versions that return Net::hostent objects. The objects have methods
that return the fields of the same name from the
hostent structure in
netdb.h:
Field | Description |
|---|---|
| Address of host, for backward compatibility |
| List of addresses returned from name server |
| Host address type |
| List of aliases |
| Length of address |
| Name of host |
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 h_
to the field name:
$host_obj->name( ) $h_name
Net::hostent exports the following.
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