#!/usr/bin/perl -w use strict; use Net::ParseWhois; # also see Net::Whois my $dom = 'domain.com'; my $w = Net::ParseWhois::Domain->new($dom); unless ($w->ok) { warn "error: " . $w->{'error'} . "\n" if $w->{'error'}; die "No whois match for $dom\n"; } my $c = $w->contacts; # or BILLING or TECHNICAL my $email = (split / / => $c->{ADMINISTRATIVE}[0])[-1]; unless ( index( $email, '@' ) > -1 ) { ($email = $c->{ADMINISTRATIVE}[-1]) =~ s/^Email: //; } print "administrative email address: $email\n";