Skip to content

Instantly share code, notes, and snippets.

@perlpilot
Created May 3, 2013 19:24
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 perlpilot/5513104 to your computer and use it in GitHub Desktop.
Save perlpilot/5513104 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl6
sub x([$first, *@rest], &op) {
my $*I = 0;
for @rest.kv -> $*I, $r { op($first, $r); }
}
my %M;
x("blosum.dat".IO.lines, sub ($h,$l) {
my @h = $h.words;
x($l.words, sub ($k, $v) {
%M{$k}{@h[$*I]} = $v;
});
});
say %M<A><Q>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment