sub _slow_is_ipv4 { shift if ref $_[0]; my $value = shift; return undef unless defined($value); my (@octets) = $value =~ /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/; return undef unless (@octets == 4); foreach (@octets) { return undef if $_ < 0 || $_ > 255; return undef if $_ =~ /^0\d{1,2}$/; } return join('.', @octets); }