[Data::Validate::IP](https://metacpan.org/pod/Data::Validate::IP) でいけそう！