If your hosts all have IP addresses and you have a DNS server for them:
- use Net::DNS to enumerate all the hosts listed
- for each host use Net::ARP to find the addresses of the hosts on the local segment
- If there are hosts on the "other side" of a router, use SNMP to retrieve those from the router or run this program on each segment