"Fossies" - the Fresh Open Source Software Archive

Member "whois/make_servers_charset.pl" (27 Jul 2017, 326 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_servers_charset.pl" see the Fossies "Dox" file reference documentation.

    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, $c) = /^([a-z0-9.-]+)\s+([a-z0-9-]+)(?:\s+(.+))?$/);
   14 
   15     if ($c) {
   16         print qq|    { "$a",\t"$b",\t"$c" },\n|;
   17     } else {
   18         print qq|    { "$a",\t"$b",\tNULL },\n|;
   19     }
   20 }
   21