Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use local .txt input files if available
  • Loading branch information
Paul Cochrane committed Apr 28, 2015
1 parent 8a490d0 commit b62f395
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion categories/rosalind/dbpr-grondilu.pl
Expand Up @@ -23,7 +23,12 @@
use LWP::Simple;

sub MAIN(Str $id = "Q5SLP9") {
for split "\n", LWP::Simple.get(qq{http://www.uniprot.org/uniprot/$id.txt}) {
my $base-path = $*PROGRAM_NAME.IO.dirname;
my $id-fname = $base-path ~ "/$id.txt";
my $input = $id-fname.IO.e
?? $id-fname.IO.slurp
!! LWP::Simple.get(qq{http://www.uniprot.org/uniprot/$id.txt});
for split "\n", $input {
if / GO\; .* \sP\: (.*?)\;/ {
say $/[0].Str
}
Expand Down

0 comments on commit b62f395

Please sign in to comment.