in reply to LWP::Simple problems

I think this code is shorter but still does what you want.

use strict; my @fasta; for my $acc (@accession) { next unless /_(\d+);/ my id = $1; my $seq = get( "http://us.expasy.org/cgi-bin/get-sprot-fasta?$id"; unless (defined $seq) { print "Couldn't find id $id\n"; next; } push @fasta, $seq; }

Replies are listed 'Best First'.
Re^2: LWP::Simple problems
by davido (Cardinal) on Jan 29, 2005 at 16:34 UTC

    Don't forget to sleep briefly between page hits.


    Dave

      If its anything like the standard expasy site, sleep forever!,
      you should read the robots.txt file, as this aint allowed,
      that said, i cant check the us mirror at the moment , perhaps you've DOS'ed it!


      I should really do something about this apathy ... but i just cant be bothered