slightly modified by me. This is the Net::IP module, designed to allow easy manipulation of IPv4 and IPv6 addresses.