Debian Codegraph @

whois/make_tld_serv.pl

raw
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
28 (my ($a, $b) = /^([\w\d\.-]+)\s+([\w\d\.:-]+|[A-Z]+\s+.*)$/);
29 $b =~ s/^W(?:EB)?\s+/\\001/;
30 $b =~ s/^M(?:SG)?\s+/\\002/;
31 $b = "\\003" if ($b eq 'NONE');
32 print " \"$a\",\t\"$b\",\n";
33 }