summaryrefslogtreecommitdiffstats
path: root/make_servers_charset.pl
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xmake_servers_charset.pl21
1 files changed, 21 insertions, 0 deletions
diff --git a/make_servers_charset.pl b/make_servers_charset.pl
new file mode 100755
index 0000000..2f83a09
--- /dev/null
+++ b/make_servers_charset.pl
@@ -0,0 +1,21 @@
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+
+while (<>) {
+ chomp;
+ s/#.*$//;
+ s/^\s+//; s/\s+$//;
+ next if /^$/;
+
+ die "format error: $_" if not
+ (my ($a, $b, $c) = /^([a-z0-9.-]+)\s+([a-z0-9-]+)(?:\s+(.+))?$/);
+
+ if ($c) {
+ print qq| { "$a",\t"$b",\t"$c" },\n|;
+ } else {
+ print qq| { "$a",\t"$b",\tNULL },\n|;
+ }
+}
+