This function does the same thing as
(3): it translates
a network hostname to its corresponding
addresses (and other names).
The return value in list context is:
($name, $aliases, $addrtype, $length, @addrs)
is a list of raw addresses. In the Internet domain, each address is
four bytes long, and can be unpacked by saying something like:
($a, $b, $c, $d) = unpack('C4', $addrs);
In scalar context,
returns only the host address.
See the section on "Sockets" in
for another approach.