| 1 |
#!/usr/bin/perl -w |
| 2 |
|
| 3 |
# Copyright (C) 1998-2026 Free Software Foundation, Inc. |
| 4 |
# |
| 5 |
# This file is part of GNU Inetutils. |
| 6 |
# |
| 7 |
# GNU Inetutils is free software: you can redistribute it and/or modify |
| 8 |
# it under the terms of the GNU General Public License as published by |
| 9 |
# the Free Software Foundation, either version 3 of the License, or (at |
| 10 |
# your option) any later version. |
| 11 |
# |
| 12 |
# GNU Inetutils is distributed in the hope that it will be useful, but |
| 13 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 |
# General Public License for more details. |
| 16 |
# |
| 17 |
# You should have received a copy of the GNU General Public License |
| 18 |
# along with this program. If not, see `http://www.gnu.org/licenses/'. |
| 19 |
|
| 20 |
use strict; |
| 21 |
|
| 22 |
while (<>) { |
| 23 |
chomp; |
| 24 |
s/^\s*(.*)\s*$/$1/; |
| 25 |
s/\s*#.*$//; |
| 26 |
next if /^$/; |
| 27 |
die "format error: $_" unless (/^([\d\.]+)\s+([\d\.]+)\s+([\w\.]+)$/); |
| 28 |
my $f=$1; my $l=$2; my $s=$3; |
| 29 |
print "{ ${f}, ${l}, \""; |
| 30 |
if ($s =~ /\./) { |
| 31 |
print "$s"; |
| 32 |
} else { |
| 33 |
print "whois.$s.net"; |
| 34 |
} |
| 35 |
print "\" },\n"; |
| 36 |
} |