#!/usr/bin/perl
use Net::EPP::Simple;
use strict;
 
my $epp = Net::EPP::Simple->new(
        host    => 'epp.nic.tld',
        user    => 'my-id',
        pass    => 'my-password',
);
 
my $domain = 'example.tld';
 
if ($epp->check_domain($domain) == 1) {
        print "Domain is available\n" ;
 
} else {
        my $info = $epp->domain_info($domain);
        printf("Domain was registered on %s by %s\n", $info->{crDate}, $info->{crID});
 
}