Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: need a xml parser module

by gube (Parson)
on Dec 12, 2007 at 10:35 UTC ( #656584=note: print w/ replies, xml ) Need Help??


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);


Comment on Re: need a xml parser module
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://656584]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (12)
As of 2014-10-20 21:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (92 votes), past polls