You could also do this with Net::CIDR::Lite, which might be worthwhile if you have alot of cidr addresses. You can not currently serialize the Net::CIDR::Lite object (I've been thinking of adding store/retrieve or freeze/thaw methods), but if you could, then it might be better than reading in the file every time (patches welcome!). Of course, if your method works, and works well enough, then no need to go to the trouble of changing... :-)