#!/usr/bin/perl -w use strict; use LWP::Simple; my $filename = $ARGV[0]; my ($url,$entry,$accession); open INPUT, "<$filename" or die "Failed to open input file\nError:$!\n"; open OUTPUT, ">$filename.entries" or die "Failed to open result file\nError:$!\n"; open STDERR, ">>$filename.web.errorlog" or die "Failed to open error log\nError:$!\n"; while (){        next if ($_ =~ /^-/ || $_ =~ /^\(/ || $_ =~ /\brzpd\b/ || $ =~ /^\n/);        $accession = substr($_,1,8);        $url = "http://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi?db=nucleotide&qty=1&c_start=1&list_uids=$accession&dopt=gb&send=Send&sendto=t&from=begin&to=end&extrafeatpresent=1&ef_MGC=16;";        $entry = get $url; warn "Couldn't get $url" unless defined $entry;        print OUTPUT $entry; } close (STDERR) or die "Failed to close error log\nError:$!\n";; close (OUTPUT) or die "Failed closing output file\nError:$!\n"; close (INPUT) or die "Failed closing input file\nError:$!\n";