Entering edit mode
9.2 years ago
Sej Modha
5.3k
I am using following code in a perl script to retrieve ScientificName for a taxid. I would also like to retrieve other fields such as species and genus but when I used the get_contents_by_name method for any other item it gives me Can't call method "get_contents_by_name" on an undefined value
error.
Any help would be appreciated.
my $factory = Bio::DB::EUtilities->new(-eutil => 'esummary',
-email => 'mymail@foo.bar',
-db => 'taxonomy',
-id => $taxid );
my ($name) = $factory->next_DocSum->get_contents_by_name('ScientificName');
# print "$name\n";
my ($genus) = $factory->next_DocSum->get_contents_by_name('Genus');
print "$genus\n";