in reply to XML parsing Help..

You need to look at the "ForceArray" option in the XML::Simple documentation.

--
<http://dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg

Replies are listed 'Best First'.
Re^2: XML parsing Help..
by bioswami (Novice) on Nov 10, 2006 at 09:41 UTC
    Thanks davorg. That does help. For someone else who comes here looking for an answer to this same Q, here is what I did:
    $xml = new XML::Simple (KeyAttr=>[],ForceArray=>['substrate','product' +]);
    So I specifically made all "substrate" and "product" elements into arrays. I then had to figure out the number of elements in that array. And this I did by:
    foreach $g (@{$data->{reaction}}){ $length = scalar @{$g->{substrate}}; print " $g->{name}, len = $length\n"; }
    Thanks for all your help! Cheers, Bioswami