Skip to content

Instantly share code, notes, and snippets.

@raydiak
Created April 28, 2014 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raydiak/11382643 to your computer and use it in GitHub Desktop.
Save raydiak/11382643 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl6
my $file = open 'MIRRORED.BY';
my %data;
my $key;
for $file.lines {
when /^ \s* '#'/ {
next
}
when /^ \s* (\S+) \s* ':' \s* $/ {
$key = $0;
}
when /^ \s* (\S+?) \s* '=' \s* \" (<-[\"]>*) \" \s* $/ {
%data{$key}{$0} = "$1";
}
when /\S/ { die "fail:\n$_" }
}
%data.perl.say;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment