#!/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;