mirror of
https://github.com/rfc1036/whois.git
synced 2026-08-01 07:20:13 +00:00
24 lines
343 B
Perl
Executable File
24 lines
343 B
Perl
Executable File
#!/usr/bin/perl
|
|
|
|
use warnings;
|
|
use strict;
|
|
|
|
while (<>) {
|
|
chomp;
|
|
s/#.*$//;
|
|
s/^\s+//; s/\s+$//;
|
|
next if /^$/;
|
|
|
|
die "format error: $_" if not (/^([\d\.]+)\s+([\d\.]+)\s+([\w\.]+)$/);
|
|
my $f = $1; my $l = $2; my $s = $3;
|
|
|
|
print qq|{ ${f}, ${l}, "|;
|
|
if ($s =~ /\./) {
|
|
print "$s";
|
|
} else {
|
|
print "whois.$s.net";
|
|
}
|
|
print qq|" },\n|;
|
|
}
|
|
|