No doubt Sam Varshavchik would welcome patches for Net::CIDR. He was happy to accept the patches I sent him to add the addr2cidr and addrandmask2cidr functions. Just remember that he wants functions to work with IPv6 addresses as well. Thankfully, using the functions he's provided for turning IPv6 addresses into a list of octets (which is a weird but convenient way of representing v6 addresses) means that the extra code to handle them is pretty trivial.