home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  

8.110 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 backwards compatibility


List of addresses returned from name server

addrtype Host address type
aliases List of aliases
length Length of address
name Name of host

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

Net::hostent exports the following: