They iterate through your /etc/hosts file and return each entry one at a time. The return value from gethostent 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);
Scripts that use these routines should not be considered portable. If a machine uses a nameserver, it would interrogate most of the Internet to try to satisfy a request for all the addresses of every machine on the planet. So these routines are unimplemented on such machines.