"Fossies" - the Fresh Open Source Software Archive

Member "whois/make_tld_serv.pl" (3 Oct 2020, 551 Bytes) of package /linux/privat/whois_5.5.9.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "make_tld_serv.pl" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 5.5.6_vs_5.5.8.

    1 #!/usr/bin/perl
    2 
    3 use warnings;
    4 use strict;
    5 
    6 while (<>) {
    7     chomp;
    8     s/#.*$//;
    9     s/^\s+//; s/\s+$//;
   10     next if /^$/;
   11 
   12     die "format error: $_" if not
   13         (my ($a, $b) = /^\.(\w[\w\d\.-]+)\s+([\w\d\.:-]+|[A-Z]+\s+.*)$/);
   14 
   15     $b =~ s/^W(?:EB)?\s+/\\x01/;
   16     $b =~ s/^VERISIGN\s+/\\x04" "/;
   17     $b = "\\x03" if $b eq 'NONE';
   18     $b = "\\x08whois.afilias-grs.info" if $b eq 'AFILIAS';
   19     $b = "\\x08$b" if $b eq 'whois.flexireg.net';
   20     $b = "\\x08$b" if $b eq 'whois.registry.in';
   21     $b = "\\x0C" if $b eq 'ARPA';
   22     $b = "\\x0D" if $b eq 'IP6';
   23     print qq|    "$a",\t"$b",\n|;
   24 }
   25