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

converting a xml page into a hash table

by juo (Curate)
on Sep 11, 2001 at 06:46 UTC ( [id://111679]=perlquestion: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.

juo has asked for the wisdom of the Perl Monks concerning the following question:

Does somebody has a subroutine that easily converts an XML page into a hash table.

  • Comment on converting a xml page into a hash table

Replies are listed 'Best First'.
Re: converting a xml page into a hash table
by Zaxo (Archbishop) on Sep 11, 2001 at 06:59 UTC
    XML

    After Compline,
    Zaxo

Re: converting a xml page into a hash table
by blakem (Monsignor) on Sep 11, 2001 at 07:01 UTC
    There are *lots* of XML modules available... if you're new to XML and your data is simple enough, I'd recommend XML::Simple, or try doing a Super Search on XML.

    -Blake

      I normally use XML::Simple to convert an XML file to a hash array. The following code will store the contents of in.xml in a hash array.

      #-- Sample code use strict; use XML::Simple; my $mXML; $mXML = XMLin('./in.xml',forcearray => 1);

      You might also want to use the Data::Dumper module to view the hash array.

      I hope this helps.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://111679]
Approved by root
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.