Looks interesting. You could also use Net::NetMask.
In reply to Re: Check IP with support for CIDR by ehdonhon in thread Check IP with support for CIDR by xaphod