File: make_tld_serv.pl

package info (click to toggle)
whois 4.5.25
  • links: PTS
  • area: main
  • in suites: woody
  • size: 200 kB
  • ctags: 84
  • sloc: ansic: 945; perl: 142; makefile: 113
file content (18 lines) | stat: -rwxr-xr-x 359 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl -w

use strict;

while (<>) {
	chomp;
	s/^\s*(.*)\s*$/$1/;
	s/\s*#.*$//;
	next if /^$/;
	die "format error: $_" unless
		(my ($a, $b) = /^([\w\d\.-]+)\s+([\w\d\.:-]+|[A-Z]+\s+.*)$/);
	$b =~ s/^W(?:EB)?\s+/\\001/;
	$b =~ s/^M(?:SG)?\s+/\\002/;
	$b = "\\004" if $b eq 'CRSNIC';
	$b = "\\003" if $b eq 'NONE';
	print "    \"$a\",\t\"$b\",\n";
}