Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: need a xml parser module

by gube (Parson)
on Dec 12, 2007 at 10:35 UTC ( [id://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);

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-03-19 09:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found