in reply to Check IP with support for CIDR

Looks interesting. You could also use Net::NetMask.