[Curitiba-pm] XML em Perl
Stanislaw Pusep
creaktive at gmail.com
Mon Oct 29 10:09:52 PDT 2012
Boa tarde, Guilherme!
Seria algo assim:
#!/usr/bin/env perl
use strict;
use warnings 'all';
use Data::Dumper;
use LWP::Simple;
use XML::Simple;
my $obj = XMLin(get('
http://www.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=taxonomy&id=192'));
print Dumper $obj->{Taxon}{OtherNames}{Synonym};
ABS()
On Mon, Oct 29, 2012 at 2:11 PM, Guilherme Rodrigues Machado <
guilherme.lrm at gmail.com> wrote:
> *Caros, boa tarde.*
>
> Estou utilizando os seguintes módulos:
> - XML::SIMPLE
> - LWP::Simple
>
> Para acessar o seguinte XML
> http://www.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=taxonomy&id=192
>
> O retorno é +/- esse:
>
> $VAR1 = {
>> 'Taxon' => {
>> 'CreateDate' => '1995/02/27 09:24:00',
>> 'Division' => 'Bacteria',
>> 'TaxId' => '192',
>> 'MitoGeneticCode' => {
>> 'MGCId' => '0',
>> 'MGCName' => 'Unspecified'
>> },
>> 'OtherNames' => {
>> 'Includes' => 'bacterium
>> ASAZOES-148',
>> 'Name' => [
>> {
>> 'DispName' =>
>> 'Roseomonas fauriae Rihs et al. 1998',
>> 'ClassCDE' =>
>> 'authority'
>> },
>> {
>> 'DispName' =>
>> 'strain sp. 7',
>> 'ClassCDE' => 'type
>> material'
>> }
>> ],
>> 'Synonym' => [
>> 'Roseomonas
>> fauriae',
>> 'Azospirillum
>> brasiliense',
>> 'Spirillum
>> lipoferum'
>> ]
>> },
>> 'LineageEx' => {
>> 'Taxon' => [
>> {
>> 'TaxId' => '131567',
>> 'Rank' => 'no rank',
>> 'ScientificName' =>
>> 'cellular organisms'
>> },
>> {
>> 'TaxId' => '191',
>> 'Rank' => 'genus',
>> 'ScientificName' =>
>> 'Azospirillum'
>> }
>> ]
>> },
>> 'Lineage' => 'cellular organisms; Bacteria;
>> Proteobacteria; Alphaproteobacteria; Rhodospirillales; Rhodospirillaceae;
>> Azospirillum',
>> 'Rank' => 'species',
>> 'GeneticCode' => {
>> 'GCName' => 'Bacterial, Archaeal
>> and Plant Plastid',
>> 'GCId' => '11'
>> },
>> 'PubDate' => '1993/04/26 01:00:00',
>> 'ScientificName' => 'Azospirillum brasilense',
>> 'UpdateDate' => '2012/10/24 17:17:04',
>> 'ParentTaxId' => '191'
>> }
>> };
>>
>
>
> Saberia dizer como eu acesso os 3 conteúdos do vetor 'SYNONYM' ?
>
> Muito obrigado.
>
> Grande abraço,
> Guilherme Machado
> UFPR - Mestrando em Bioinformática
>
> _______________________________________________
> Curitiba-pm mailing list
> Curitiba-pm at pm.org
> http://mail.pm.org/mailman/listinfo/curitiba-pm
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/curitiba-pm/attachments/20121029/56803bdc/attachment-0001.html>
More information about the Curitiba-pm
mailing list