I have a list of protein GI and would like to get accession number of the genome (DBSOURCE in genbank file) using Eutilities.

What would be the easiest way to get genome accession numbers for a list of protein GI?
Here is a perl script to do this. This script is explained in detail [here](http://bioinformatics.cvr.ac.uk/blog/?p=276)

    #!/usr/bin/perl
    
    use Bio::DB::EUtilities;
    
    #my @ids     = qw(817524604 726965494);
    my $infile = $ARGV[0];
    my @ids;
    
    open (IN,"$infile")||die "can't open $infile\n";
    
    while(<IN>)
    {
      chomp($_);
      my @ids=$_;
    # print @ids."\n";    
      my $factory = Bio::DB::EUtilities->new(-eutil          => 'elink',
                                           -email          => 'mymail@foo.bar',
                                           -db             => 'nucleotide',
                                           -dbfrom         => 'protein',
                                           -correspondence => 1,
                                           -id             => \@ids);
     
      # iterate through the LinkSet objects
      while (my $ds = $factory->next_LinkSet) 
      {
        #print "   Link name: ",$ds->get_link_name,"\n";
        my $protid = join(',',$ds->get_submitted_ids);
        print "Protein ID:" . $protid ."\t";
        #print "Protein ID: ",join(',',$ds->get_submitted_ids),"\t";
        my $nucid = join(',',$ds->get_ids);
        print "Nuc ID:" . $nucid ."\t";
        my $factory = Bio::DB::EUtilities->new(-eutil   => 'efetch',
                               -db      => 'nucleotide',
                                                  -id      => $nucid,
                                                  -email   => 'mymail@foo.bar',
                                                  -rettype => 'acc');
       my @accs = split(m{\n},$factory->get_Response->content);
       print "Genome Accession: " .join(',',@accs), "\n";
       }
    }