but still don't know what to do. The following script is a model provided by http://www.uniprot.org/faq/28 to convert one form of a protein ID to another, It outputs to the screen and I need it to go to a file:http://search.cpan.org/~gaas/libwww-perl-6.02/lib/LWP/UserAgent.pm
Thanks,next time I'll do the tutorial on OOP. Chetuse strict; use warnings; use LWP::UserAgent; my $base = 'http://www.uniprot.org'; my $tool = 'mapping'; my $params = { from => 'ACC', to => 'P_REFSEQ_AC', format => 'tab', query => 'P13368 P20806 Q9UM73 P97793 Q17192' }; my $agent = LWP::UserAgent->new; push @{$agent->requests_redirectable}, 'POST'; my $response = $agent->post("$base/$tool/", $params); while (my $wait = $response->header('Retry-After')) { print STDERR "Waiting ($wait)...\n"; sleep $wait; $response = $agent->get($response->base); } $response->is_success ? print $response->content : die 'Failed, got ' . $response->status_line . ' for ' . $response->request->uri . "\n";
In reply to LWP::UserAgent -output to file? by cseligman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |