http://qs321.pair.com?node_id=656584


in reply to need a xml parser module

Hi, Use this below code

#!/usr/local/bin/perl use strict; use warnings; use XML::Simple qw/:strict/; use Data::Dumper; my $xml = qq{ <InteractionComponentList> <InteractionComponent role_type="input" molecule_idref="200568"></Inte +ractionComponent></InteractionComponentList>}; my $xml_simple = XML::Simple->new(KeyAttr => 1, KeepRoot => 1, ForceAr +ray => 1); my $output = $xml_simple->XMLin($xml); my %hash = %{$output->{InteractionComponentList}[0]{InteractionCompone +nt}[0]}; print Dumper(\%hash);