summaryrefslogtreecommitdiff
path: root/cidhash.pl
blob: 70e5f0fef15041804c34b9e04c7daf615a6102d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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";
}