"Fossies" - the Fresh Open Source Software Archive

Member "whois-5.4.3/make_as32_del.pl" (27 Jul 2017, 603 Bytes) of package /linux/privat/whois_5.4.3.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_as32_del.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     my ($fh, $fl, $lh, $ll, $s, $f, $l);
   13     if (($fh, $fl, $lh, $ll, $s) =
   14             /^(\d+)\.(\d+)\s+(\d+)\.(\d+)\s+([\w\.-]+)$/) {
   15         $f = ($fh << 16) + $fl;
   16         $l = ($lh << 16) + $ll;
   17 
   18         my $server = ($s =~ /\./) ? $s : "whois.$s.net";
   19         print qq|{ ${f}u, ${l}u,\t"$server" },\t/* $fh.$fl $lh.$ll */\n|;
   20     } elsif (($f, $l, $s) = /^(\d+)\s+(\d+)\s+([\w\.-]+)$/) {
   21         my $server = ($s =~ /\./) ? $s : "whois.$s.net";
   22         print qq|{ ${f}u, ${l}u,\t"$server" },\n|;
   23     } else {
   24         die "format error: $_";
   25     }
   26 }
   27