mirror of
https://github.com/rfc1036/whois.git
synced 2026-04-03 06:40:52 +00:00
22 lines
405 B
Perl
Executable File
22 lines
405 B
Perl
Executable File
#!/usr/bin/perl
|
|
|
|
use warnings;
|
|
use strict;
|
|
|
|
while (<STDIN>) {
|
|
chomp;
|
|
s/^\s*(.+)\s*$/$1/;
|
|
s/\s*#.*$//;
|
|
next if /^$/;
|
|
|
|
my ($fh, $fl, $lh, $ll, $s) = /^(\d+)\.(\d+)\s+(\d+)\.(\d+)\s+([\w\.-]+)$/;
|
|
die "format error: $_" unless $s;
|
|
|
|
my $f = ($fh << 16) + $fl;
|
|
my $l = ($lh << 16) + $ll;
|
|
my $server = ($s =~ /\./) ? $s : "whois.$s.net";
|
|
|
|
print qq({ $f, $l,\t"$server" },\t/* $fh.$fl $lh.$ll */\n);
|
|
}
|
|
|