summaryrefslogtreecommitdiff
path: root/cidhash.pl
diff options
context:
space:
mode:
Diffstat (limited to 'cidhash.pl')
-rwxr-xr-xcidhash.pl13
1 files changed, 13 insertions, 0 deletions
diff --git a/cidhash.pl b/cidhash.pl
new file mode 100755
index 0000000..70e5f0f
--- /dev/null
+++ b/cidhash.pl
@@ -0,0 +1,13 @@
+#!/usr/bin/perl
+
+use Text::CSV_XS;
+use Locale::Country;
+
+$csv = new Text::CSV_XS;
+
+while (<>) {
+ my $status = $csv->parse($_) or die "can't parse: ".$csv->error_input."\n";
+ my($cid, $name) = $csv->fields();
+
+ print " '".country2code($name). "' => ", $cid. ",\n";
+}