mirror of
https://github.com/rfc1036/whois.git
synced 2026-01-03 06:15:17 +00:00
C hexadecimal escape sequences are actually defined as \x followed by *any* number of hexadecimal digits.
23 lines
402 B
Prolog
Executable File
23 lines
402 B
Prolog
Executable File
#!/usr/bin/perl
|
|
|
|
use warnings;
|
|
use strict;
|
|
|
|
while (<>) {
|
|
chomp;
|
|
s/#.*$//;
|
|
s/^\s+//; s/\s+$//;
|
|
next if /^$/;
|
|
|
|
die "format error: $_" unless
|
|
(my ($a, $b) = /^([\w\d\.-]+)\s+([\w\d\.:-]+|[A-Z]+\s+.*)$/);
|
|
|
|
$b =~ s/^W(?:EB)?\s+/\\x01/;
|
|
$b =~ s/^VERISIGN\s+/\\x04" "/;
|
|
$b = "\\x03" if $b eq 'NONE';
|
|
$b = "\\x08" if $b eq 'AFILIAS';
|
|
$b = "\\x0C" if $b eq 'ARPA';
|
|
print qq( "$a",\t"$b",\n);
|
|
}
|
|
|