Skip to content
This repository has been archived by the owner on Jan 2, 2019. It is now read-only.

Commit

Permalink
extracredit
Browse files Browse the repository at this point in the history
  • Loading branch information
elizabeth de vogelaere committed Oct 22, 2015
1 parent 03cee72 commit 0390785
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions week8/extra-credit.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env perl
#extra-credit.pl
use strict;
use warnings;
use autodie;
use feature 'say';
use Data::Dumper;

my $file = shift || 'rebase.txt';
open my $fh, '<', $file;

my %enzymes;
while (my $line = <$fh>) {
if ($line =~ /^([\w\s\(\)]+)\s+\b([A-Z\^]+)$/) {
my ($name, $val) = ($1, $2);
$name =~ s/\s*$//;
$enzymes{ $name } = $val;
}
}

say STDERR Dumper(\%enzymes);
printf "There are %s enzymes.\n", scalar keys %enzymes;
Empty file modified week8/rebase.txt
100755 → 100644
Empty file.

0 comments on commit 0390785

Please sign in to comment.