Skip to content

Commit b62f395

Browse files
committed
Use local .txt input files if available
1 parent 8a490d0 commit b62f395

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

categories/rosalind/dbpr-grondilu.pl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@
2323
use LWP::Simple;
2424

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

0 commit comments

Comments
 (0)