In fact you can call IP::Check instead of separating IP::Check4 and 6 calls. Moreover pattern for matching a valid IPv6 is a bit complicated than this one used.