Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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 meditating upon the Monastery: (6)
As of 2015-08-01 03:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (285 votes), past polls