This isn't a bug in this module, but a result of an old version of Net::Domain::TLD. Net::Domain::TLD 1.73 (and possibly earlier) supports IDNs which means in turn that Data::Validate::Domain's is_domain() does.
use feature qw(say);
use Net::Domain::TLD qw(tld_exists);
use Data::Validate::Domain qw(is_domain);
my $uri = "
http://xn--p8j9a0d9c9a.xn--q9jyb4c/index.html";
my $domain = "xn--p8j9a0d9c9a.xn--q9jyb4c";
my $tld = "xn--q9jyb4c";
say "Net::Domain::TLD::VERSION: $Net::Domain::TLD::VERSION";
say "Data::Validate::Domain::VERSION: $Data::Validate::Domain::VERSION";
say "tld_exists: " . tld_exists($tld);
say "is_domain: " . is_domain(
$domain,
{
'domain_allow_underscore' => 1,
'domain_private_tld' => qr/^[a-z0-9]+$/,
}
) // "Not defined";
__END__
Outputs:
Net::Domain::TLD::VERSION: 1.72
Data::Validate::Domain::VERSION: 0.10
tld_exists: 1
is_domain: xn--p8j9a0d9c9a.xn--q9jyb4c
and:
Net::Domain::TLD::VERSION: 1.69
Data::Validate::Domain::VERSION: 0.10
tld_exists: 0
is_domain: