Group
Extension

Matches 2

Net-Domain-Parts ( S/ST/STEVEB/Net-Domain-Parts-0.04.tar.gz, STEVEB, 2025; MetaCPAN )
Net-Domain-Parts/bin/generate-tld-json.pl ( view source; MetaCPAN )
#!/usr/bin/env perl

use warnings;
use strict;

use Data::Dumper;
use File::Edit::Portable;
use JSON;

# This script updates the lib/Net/Domain/Parts.pm file with updated TLD data

# To use it, downlo
entioned library file, then run the script

my $tld_txt_file = 'data/tld.txt';
my $tld_json_file = 'data/tld.json';

open my $fh, '<', $tld_txt_file or die "Can't open $tld_txt_file for reading: $!";
pen my $wfh, '>', $tld_json_file or die "Can't open $tld_json_file for writing: $!";
my $json = JSON->new->pretty->encode(\%data);
print $wfh $json;
print "\nWrote out $tld_json_file\n";
close $wfh;

Net-Domain-Parts ( S/ST/STEVEB/Net-Domain-Parts-0.04.tar.gz, STEVEB, 2025; MetaCPAN )
Net-Domain-Parts/lib/Net/Domain/Parts.pm ( view source; MetaCPAN )
package Net::Domain::Parts;

use strict;
use warnings;

use Carp qw(croak);
use Data::Dumper;
use JSON;

use Exporter;
our @ISA = qw(Exporter);
our @EXPORT = qw(
    domain_parts
);

our @EXPORT_OK = 
TAGS{all} = [@EXPORT, @EXPORT_OK];

our $VERSION = '0.04';

my $json;
{
    local $/;
    $json = <DATA>;
}

my $tlds = decode_json($json);

sub domain_parts {
    my ($domain_name) = @_;

    if (! d

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.