in reply to How to access results of XML::Simple?

The first element in your XML is your XML document. If you want to have more than one "gene" element, you'll have to enclose them in something else.

<?xml version="1.0"?> <genecollection> <gene id = "2" label = "gene of some interest" /> <gene id = "3" label = "gene of more interest" /> </genecollection>

Then their IDs would be keys %{$xml->{gene}} and the label of the gene with the id of 2, for example, would be $xml->{gene}{2}{label}... Is that what you are trying to do?

-sauoq
"My two cents aren't worth a dime.";

Replies are listed 'Best First'.
Re: Re: XML::Simple
by matth (Monk) on Dec 18, 2002 at 15:37 UTC
    Yes, I am trying to do something like that. This is a useful bit of code. Thanks.