blob: 324d3d28a6ccc5fd22b67e4eaec683cd118b7504 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#!/usr/bin/perl -w
use strict;
while (<>) {
chomp;
s/^\s*(.*)\s*$/$1/;
s/\s*#.*$//;
next if /^$/;
die "format error: $_" unless (/^([\d\.]+)\s+([\d\.]+)\s+([\w\.]+)$/);
my $f=$1; my $l=$2; my $s=$3;
print "{ ${f}, ${l}, \"";
if ($s =~ /\./) {
print "$s";
} else {
print "whois.$s.net";
}
print "\" },\n";
}
|