Quick and dirty script to grok country codes
1 files changed, 37 insertions(+), 0 deletions(-)

A => bin/overham/iso.pl
A => bin/overham/iso.pl +37 -0
@@ 0,0 1,37 @@ 
+#!/usr/bin/env perl
+
+use IO::File;
+use Readonly;
+use Data::Dumper;
+use English;
+use strict;
+use warnings;
+
+Readonly my $FILE => 'input.txt';
+sub main {
+	my %map;
+	my $col = 0;
+	my $file = IO::File->new($FILE, 'r');
+
+	if ($file) {
+		my $name = 'UNKNOWN';
+		while (defined(my $line = <$file>)) {
+			chomp($line);
+			if ($col == 0) {
+				$name = $line;
+			} elsif ($col == 2) {
+				$map{$name} = $line;
+			}
+			$col++;
+			$col = 0 if ($col == 5);
+		}
+		print Dumper \%map;
+	} else {
+		printf(STDERR "Cannot open '%s' - %s'\n", $FILE, $ERRNO);
+		return 1;
+	}
+
+	return 0;
+}
+
+exit(main());