whois/make_servers_charset.pl
Petr Menšík 6761f80395 Add SPDX license identifiers to code files
Change manual pages word to recognize it by licensecheck tool.
2023-07-22 17:38:06 +02:00

23 lines
370 B
Perl
Executable File

#!/usr/bin/perl
# SPDX-License-Identifier: GPL-2.0-or-later
use warnings;
use strict;
while (<>) {
chomp;
s/#.*$//;
s/^\s+//; s/\s+$//;
next if /^$/;
die "format error: $_" if not
(my ($a, $b, $c) = /^([a-z0-9.-]+)\s+([a-z0-9-]+)(?:\s+(.+))?$/);
if ($c) {
print qq| { "$a",\t"$b",\t"$c" },\n|;
} else {
print qq| { "$a",\t"$b",\tNULL },\n|;
}
}