Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

I finally get to help. *Smiles*

by Rhose (Priest)
on Aug 22, 2001 at 01:26 UTC ( [id://106784]=note: print w/replies, xml ) Need Help??


in reply to XML format help

What you are experiencing can be corrected by setting forcearray => 1 with XMLin(). I threw together a quick example which will demonstrate the differences. (Your sample XML file is in.xml.)

One other thing I have found to be helpful when working with XML::Simple is Data::Dumper.

#-- Sample code use strict; use XML::Simple; my $mXML; print "Without forcearray...\n"; $mXML = XMLin('./in.xml'); print XMLout($mXML); print "\n\n"; print "With forcearray...\n"; $mXML = XMLin('./in.xml',forcearray => 1); print XMLout($mXML);

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-03-29 04:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found