--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+my $file = shift;
+
+die "no file $file" unless -f $file;
+
+open (my $fh, '<', $file) or die "Could not open $file: $!";
+
+my @mirrors;
+my $data;
+while (my $line = <$fh>) {
+ chomp $line;
+ if ($line =~ /([^:]+): (.*)/) {
+ my $key = lc($1);
+ my $value = $2;
+ $data->{$key} = $value;
+ } elsif ($line eq '') {
+ push @mirrors, $data;
+ $data = undef;
+ } else {
+ print "Malformed line: $line\n";
+ }
+}
+
+foreach my $mirror (@mirrors) {
+ my ($c, $r) = split (/ +/, $mirror->{'country'});
+ printf ("%s http://%s%s\n", $c, $mirror->{'site'}, $mirror->{'grml-http'});
+}